-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.vendor.config.js
34 lines (33 loc) · 1.01 KB
/
webpack.vendor.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
var webpack = require('webpack');
const path = require('path');
module.exports = {
entry: {
vendor: ['jquery']
},
devtool: '#cheap-module-eval-source-map',
output: {
path: path.join(__dirname, "dist"),
filename: "MyDll.[name].js",
library: "[name]_[hash]"
},
plugins: [
new webpack.DllPlugin({
path: path.join(__dirname, "dist", "[name]-manifest.json"),
name: "[name]_[hash]"
}),
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
// filename: 'static/js/[name].js',
minChunks: function(module, count) {
// any required modules inside node_modules are extracted to vendor
return (
module.resource &&
/\.js$/.test(module.resource) &&
module.resource.indexOf(
path.join(__dirname, 'node_modules')
) === 0
)
}
}),
],
}