You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Doing some googling and realize i have to duplicate shim on grunt file
varfs=require('fs'),shims=require('../shim/shim.js'),alias=require('../shim/browser.js'),sharedModules=Object.keys(shims).concat([// place all modules you want in the lib build here]);module.exports=functionbrowserify(grunt){// Load taskgrunt.loadNpmTasks('grunt-browserify');varbrowserifyProduction={options: {browserifyOptions: {debug: false},require: sharedModules,preBundleCB: function(b){b.transform({global: true},'browserify-shim')}},files: [{expand: true,cwd: 'public/js/',src: '*.js',dest: 'build/js'}]}
All shimmed files are pulled in, however i have trouble with the "require" part. jQuery is pulled in for example, but it's said jQuery not defined when run in browser, realize that the hash is not maintained as the old grunt
Anyone has the same issue and know how to fix it?
Thank you
Kareen
The text was updated successfully, but these errors were encountered:
lelea2
changed the title
Trouble using grunt-shim with grunt-browserify
Trouble using browserify-shim with grunt-browserify
Oct 29, 2015
I have trouble with using grunt-shim with grunt-browserify.
So basically, i have shim configured in package.json
under tasks/shim/shim.js
Doing some googling and realize i have to duplicate shim on grunt file
All shimmed files are pulled in, however i have trouble with the "require" part. jQuery is pulled in for example, but it's said jQuery not defined when run in browser, realize that the hash is not maintained as the old grunt
Anyone has the same issue and know how to fix it?
Thank you
Kareen
The text was updated successfully, but these errors were encountered: