From e26ef59ea24e1849a22fe34ea282573d2f527f2a Mon Sep 17 00:00:00 2001 From: JuliusR <> Date: Sat, 18 Dec 2021 14:35:53 +0100 Subject: [PATCH] add jquery (via webpack) --- config/webpack/environment.js | 8 ++++++++ package.json | 1 + yarn.lock | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/config/webpack/environment.js b/config/webpack/environment.js index d16d9af..4acbfff 100644 --- a/config/webpack/environment.js +++ b/config/webpack/environment.js @@ -1,3 +1,11 @@ const { environment } = require('@rails/webpacker') +const webpack = require('webpack') + +environment.plugins.prepend('Provide', + new webpack.ProvidePlugin({ + $: 'jquery/src/jquery', + jQuery: 'jquery/src/jquery' + }) +) module.exports = environment diff --git a/package.json b/package.json index ded8a04..79f44c1 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "@rails/activestorage": "^6.0.0", "@rails/ujs": "^6.0.0", "@rails/webpacker": "5.4.3", + "jquery": "^3.6.0", "turbolinks": "^5.2.0", "webpack": "^4.46.0", "webpack-cli": "^3.3.12" diff --git a/yarn.lock b/yarn.lock index 1dbd11e..a46182f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3805,6 +3805,11 @@ jest-worker@^26.5.0: merge-stream "^2.0.0" supports-color "^7.0.0" +jquery@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.6.0.tgz#c72a09f15c1bdce142f49dbf1170bdf8adac2470" + integrity sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw== + js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"