We've moved discussions to Discord

using jQuery in JumpStart Pro...

Bob Walsh
I want to install jQuery in a semi-fresh jumpstart pro instance. the various posts I've read say I need to install the following in webpack/environment:
const webpack = require('webpack')
 | environment.plugins.prepend('Provide',
 |   new webpack.ProvidePlugin({
 |     $: 'jquery/src/jquery',
 |     jQuery: 'jquery/src/jquery'
 |   })
 | )

But jumpstart pro has webpack/base.js and no environment.js.

Do I add environment.js? if not, how do I this to base.js?
Chris Oliver
We use Webpacker 6, which moves environment.js to base.js. You can put everything in there and follow the Webpacker 6 readme/docs. 👍 
Javier Sanz
Bob Walsh   This https://dev.to/botreetechnologies/rails-6-upgrade-and-using-jquery-with-webpacker-3bib worked for me (point 3)
Javier Sanz There is no config/webpack/environment.js file in JSP.

Did you create that new file? If so, did that not break the development.js etc in same folder?

Or did you add that code to config/webpack/base.js ?
Or did you add that code to config/webpack/development.js ?
And did you actually use
module.exports = environment
or did you modify the
module.exports = merge
in JSP?


Jim Lindsey
JPW did you figure out a solution to this?

Notifications
You’re not receiving notifications from this thread.