-
Notifications
You must be signed in to change notification settings - Fork 128
/
build.js
executable file
·63 lines (62 loc) · 1.3 KB
/
build.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
58
59
60
61
62
63
import purgecss from '@fullhuman/postcss-purgecss'
import css from './css'
const build = {
// extend webpack config here
extend(config, ctx) {
config.module.rules.push({
test: /\.md$/,
use: [{ loader: 'gray-matter-loader' }]
})
config.resolve.alias.vue = 'vue/dist/vue.common'
}
}
if (process.env.NODE_ENV === 'production') {
build.analyze = true
build.postcss = {
preset: {
features: {
customProperties: false
}
},
plugins: [
purgecss({
content: [
'./pages/**/*.vue',
'./layouts/**/*.vue',
'./components/**/*.vue'
],
css: css,
whitelist: [
'html',
'body',
'is-1by1',
'is-5by4',
'is-5by4',
'is-4by3',
'is-3by2',
'is-5by3',
'is-16by9',
'is-2by1',
'is-3by1',
'is-4by5',
'is-3by4',
'is-2by3',
'is-3by5',
'is-9by16',
'nuxt__build_indicator',
'__nuxt',
'svg',
'table',
'td',
'th',
'tr',
'tbody',
'thead',
'tfoot'
],
whitelistPatterns: [/theme/g, /spinner-position/, /fa/, /table/g]
})
]
}
}
export default build