forked from mosufy/lumen-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.dll.js
49 lines (47 loc) · 1.13 KB
/
webpack.dll.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/**
* webpack.dll.js
*
* Webpack’s DLLPlugin to build all dependencies into a single file.
*
* @date 27/10/2016
* @author Mosufy <[email protected]>
* @copyright Copyright (c) Mosufy
*/
var path = require("path");
var webpack = require("webpack");
var AssetsPlugin = require('assets-webpack-plugin');
module.exports = {
entry: {
vendor: [path.join(__dirname, "vendors.js")]
},
output: {
path: path.join(__dirname, "public", "js", "dll"),
filename: "dll.[name]-[hash].js",
library: "[name]"
},
plugins: [
new webpack.DllPlugin({
path: path.join(__dirname, "public", "js", "dll", "[name]-manifest.json"),
name: "[name]",
context: __dirname
}),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
}),
new webpack.DefinePlugin({
'process.env':{
'NODE_ENV': JSON.stringify('production')
}
}),
new AssetsPlugin({
filename: 'webpack.dll.manifest.json'
})
],
resolve: {
root: path.resolve(__dirname, "public"),
modulesDirectories: ["node_modules"]
}
};