Closed fowlercraig closed 2 years ago
Install the jquery
npm package and instead of modifying the webpack config try adding the following code to the src/main.js
file (somewhere at the top):
import $ from 'jquery'
window.jQuery = $
window.$ = $
that worked, thanks!
Operating system
macOS Big Sur
Node.js version
16
Shopify CLI version
2
Browsers
Chrome, Safari
Version
4 (Current)
Modifications
No response
Details
Can you explain the steps to adding jQuery?
I have a couple plugins that unfortunately required it -- I've tried a number of ways including using the ProvidePlugin in the webpack configuration, but keep getting the error "$ is undefined".
Notice