Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to add the bootstrap.min.js which in node_modules/bootstrap/dist/js/... #11

Open
YuxinChou opened this issue Jul 17, 2016 · 0 comments

Comments

@YuxinChou
Copy link

I have saw the question No.5(#5) Proper way to include JS and CSS libs?

But i also don't know how to do that...
Can you give a more detailed example for "how to add the bootstrap.min.js" ...

gulp.task('webpack', function(callback) {
var webpackPlugins = [
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery"
}),
new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.js'),
new webpack.DefinePlugin({
"process.env": {
NODE_ENV: JSON.stringify(args.production ? 'production' : 'development'),
},
})
];

if (args.production) {
webpackPlugins.push(new webpack.optimize.UglifyJsPlugin({minimize: true}));
}

var webpackConfig = {
context: path.join(__dirname, site.metalsmith.config.scriptRoot),
entry: {
app: './app',
vendor: ['jquery']
},
output: {
path: path.join(__dirname, site.metalsmith.config.assetRoot, 'assets'),
filename: '[name].js'
},
resolveLoader: {
root: path.join(__dirname, 'node_modules'),
},
module: {
loaders: [
{
test: /.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel?optional[]=runtime&stage=0'
}
]
},
plugins: webpackPlugins
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant