webpack.dll.config.js
1.8 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import path from 'path';
import webpack from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';
const rootPath = path.resolve(__dirname, '..');
const vendor = [
"classnames",
"connected-react-router",
"es6-promise",
"history",
"isomorphic-fetch",
"localforage",
"plupload",
"rc-animate",
"react",
"react-dom",
"react-loadable",
"react-redux",
"react-router",
"react-router-dom",
"reduce-reducers",
"redux",
"redux-form",
"redux-saga"
];
module.exports = {
entry: {
vendor: vendor
},
output: {
path: path.resolve(rootPath, 'temp_build'),
filename: '[name].[chunkhash].js',
library: '[name]_[chunkhash]',
publicPath: '/'
},
cache: true,
mode: 'production',
stats: {
assets: true,
assetsSort: 'chunks',
children: false,
colors: true,
reasons: false,
hash: false,
env: true,
version: true,
timings: true,
chunks: false,
chunkGroups: false,
chunkModules: false,
chunkOrigins: false,
modules: false,
cached: false,
moduleTrace: false,
performance: true,
warnings: false,
cachedAssets: false
},
plugins: [
new webpack.DllPlugin({
path: path.resolve(rootPath, 'temp_build', '[name].manifest.json'),
name: '[name]_[chunkhash]'
}),
new HtmlWebpackPlugin({
"title": 'Custom template',
"csrfToken": '<%=htmlWebpackPlugin.options.csrfToken%>',
"filename": path.resolve(rootPath, 'temp_build', 'index-production.html'),
"inject": 'head',
"template": path.resolve(rootPath, 'src', 'index-template.html')
})
]
};