Skip to content

Commit

Permalink
Load jQuery to global variable. It is required to run Twitter Bootstr…
Browse files Browse the repository at this point in the history
…ap scripts. Fix webpack dev and dist config created by Yeoman's generator to include plugins defined in base config.
  • Loading branch information
dzwiedziu-nkg committed Mar 14, 2017
1 parent cb326b8 commit a452019
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cfg/base.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';
let path = require('path');
let defaultSettings = require('./defaults');
const webpack = require('webpack');

// Additional npm or bower modules to include in builds
// Add all foreign plugins you may need into this array
Expand Down Expand Up @@ -39,5 +40,10 @@ module.exports = {
'react/lib/ReactMount': 'react-dom/lib/ReactMount'
}
},
module: {}
module: {},
plugins: [
new webpack.ProvidePlugin({
jQuery: 'jquery'
})
],
};
3 changes: 3 additions & 0 deletions cfg/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,7 @@ config.module.loaders.push({
)
});

// Add plugins defined in base.js
config.plugins = baseConfig.plugins.concat(config.plugins);

module.exports = config;
3 changes: 3 additions & 0 deletions cfg/dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,7 @@ config.module.loaders.push({
)
});

// Add plugins defined in base.js
config.plugins = baseConfig.plugins.concat(config.plugins);

module.exports = config;

0 comments on commit a452019

Please sign in to comment.