-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathproduction.webpack.config.js
54 lines (53 loc) · 1.17 KB
/
production.webpack.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// mini-css-extract-plugin 不支持 webpack5
// const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const { merge } = require('webpack-merge');
const config = require('./base.webpack.config');
module.exports = merge(config, {
mode: 'production',
entry: {
main: './src/main.js',
},
output: {
filename: '[name]-[contenthash:8].js',
},
// module: {
// rules: [
// {
// test: /\.css$/,
// use: [
// {
// loader: MiniCssExtractPlugin.loader,
// },
// 'css-loader',
// ],
// },
// {
// test: /\.scss$/,
// use: [
// // {
// // loader: MiniCssExtractPlugin.loader,
// // },
// 'css-loader',
// 'postcss-loader',
// 'sass-loader',
// ],
// },
// ],
// },
plugins: [
// new MiniCssExtractPlugin({
// filename: '[name]-[contenthash:8].css',
// chunkFilename: '[id].css',
// }),
],
externals: {
vue: 'Vue',
'element-ui': 'ELEMENT',
},
optimization: {
// 提出webpack运行时代码
runtimeChunk: {
name: 'runtime',
},
},
});