-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.prod.dll.babel.js
57 lines (55 loc) · 1.33 KB
/
webpack.prod.dll.babel.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
50
51
52
53
54
55
56
57
import Path from 'path'
import Webpack from 'webpack'
module.exports = {
devtool: 'cheap-module-source-map',
entry: {
vendor: ['babel-polyfill', Path.join(__dirname, 'src', 'vendors.js')],
},
output: {
path: Path.join(__dirname, 'dist', 'dll'),
filename: 'dll.[name].js',
library: '[name]',
},
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
query: {
cacheDirectory: true, // important for performance
plugins: ['transform-regenerator'],
presets: [
'react',
['es2015', { modules: false }],
'stage-0',
],
},
},
],
},
plugins: [
new Webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
}),
new Webpack.LoaderOptionsPlugin({
minimize: true,
debug: false
}),
new Webpack.DllPlugin({
path: Path.join(__dirname, 'dll', '[name]-manifest.json'),
name: '[name]',
context: Path.resolve(__dirname, 'src'),
}),
new (Webpack.optimize.OccurenceOrderPlugin || Webpack.optimize.OccurrenceOrderPlugin)(),
new Webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
}),
],
resolve: {
modules: [Path.resolve(__dirname, 'src'), 'node_modules'],
},
}