Closed aschwersenz closed 9 years ago
In the docs it says here https://github.com/thlorenz/browserify-shim#3-provide-browserify-shim-config that "The above includes ./js/vendor/jquery.js (relative to the package.json) in the bundle and exports window.$.", so in my understanding the following should work:
I have a jquery-2.1.4.min.js in a folder ./assets/vendor/ I'm adding this code to my package.json
"browserify": { "transform": [ "browserify-shim" ] }, "browserify-shim": { "./assets/vendor/jquery-2.1.4.min.js": "$" }
_ I have a js file with console.log(window.$)
console.log(window.$)
But when I'm running browserify with this configuration jquery gets not included in my bundle and the console.log() returns undefined.
Why? Am i missing something?
Can you post the JS where jQuery is required?
Never mind, I completely misunderstood what browserify shim is doing. Got it now :)
In the docs it says here https://github.com/thlorenz/browserify-shim#3-provide-browserify-shim-config that "The above includes ./js/vendor/jquery.js (relative to the package.json) in the bundle and exports window.$.", so in my understanding the following should work:
I have a jquery-2.1.4.min.js in a folder ./assets/vendor/ I'm adding this code to my package.json
_ I have a js file with
console.log(window.$)
But when I'm running browserify with this configuration jquery gets not included in my bundle and the console.log() returns undefined.
Why? Am i missing something?