forked from aeternity/aepp-boilerplate-vue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.prod.js
50 lines (47 loc) · 1.3 KB
/
webpack.prod.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
const merge = require('webpack-merge');
const common = require('./webpack.common.js');
const path = require('path');
module.exports = merge(common, {
mode: 'production',
output: {
filename: 'bundle.js?[hash]',
publicPath: './'
},
module: {
rules: [
{
test: /\.css$/,
use: [
'vue-style-loader',
'css-loader',
{
loader: 'postcss-loader',
options: {
ident: 'postcss',
plugins: [
require('postcss-import'),
require('tailwindcss'),
require('autoprefixer'),
require('@fullhuman/postcss-purgecss')({
content: [
path.join(__dirname, './src/index.html'),
path.join(__dirname, './**/*.vue'),
path.join(__dirname, './src/**/*.js')
],
whitelistPatterns: [/^ae/],
defaultExtractor: content => content.match(/[\w-/:]+(?<!:)/g) || []
}),
require('cssnano')({
'preset': [
'default',
{'discardComments': {'removeAll': true}}
]
})
]
}
}
]
}
]
}
});