-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.dll.config.js
More file actions
32 lines (31 loc) · 927 Bytes
/
Copy pathwebpack.dll.config.js
File metadata and controls
32 lines (31 loc) · 927 Bytes
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
const path = require('path');
const webpack = require('webpack');
const AssetsPlugin = require('assets-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const pkg = require('./package.json'); // 引入package.json
const env = process.env.WEBPACK_ENV;
module.exports = {
entry: {
dev: Object.keys(pkg.dependencies)
},
output: {
path: path.resolve(__dirname, './static'),
filename: '[name].dll.[chunkhash:5].js',
library: '[name]_lib_[chunkhash:5]'
},
plugins: [
new webpack.DllPlugin({
path: path.join(__dirname, '.', '[name]-manifest.json'),
name: '[name]_lib_[chunkhash:5]',
context: __dirname
}),
new CleanWebpackPlugin('./static'),
new AssetsPlugin({
filename: './static/webpack.assets.js',
processOutput: assets => `window.WEBPACK_ASSETS = ${JSON.stringify(assets)}`
})
],
optimization: {
minimize: true
}
};