-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.pro.config.js
40 lines (36 loc) · 1.06 KB
/
webpack.pro.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
const path = require('path');
const config=require('./webpack.base.config.js');
const addAssetHtmlPlugin = require('add-asset-html-webpack-plugin');
const extractTextWebpackPlugin = require('extract-text-webpack-plugin');
const dlls = require('./config.js').dlls.map(item=>item.key).reverse();
config.module.rules.push({
test: /\.less?$/,
use: extractTextWebpackPlugin.extract({
fallback: 'style-loader',
use: [
'css-loader',
'less-loader',
]
})
});
config.module.rules.push({
test: /\.css?$/,
use: extractTextWebpackPlugin.extract({
fallback: 'style-loader',
use: [
'css-loader'
]
})
});
config.plugins.push(new extractTextWebpackPlugin('css/style-[hash].css'));
dlls.forEach(key=>{
config.plugins.push(new addAssetHtmlPlugin({
filepath: path.resolve(__dirname, `./dll/${key}/${key}.js`),
outputPath: './dll',
publicPath: '/dll/',
includeSourcemap: false,
}));
})
config.stats='normal';
// config.devtools=null;
module.exports=config;