-
Notifications
You must be signed in to change notification settings - Fork 0
/
nuxt.config.js
103 lines (96 loc) · 1.83 KB
/
nuxt.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
const webpack = require('webpack')
const dotenv = require('dotenv').config()
const PurgecssPlugin = require('purgecss-webpack-plugin')
module.exports = {
/**
* Nuxt extensions
* @type {Array}
*/
modules: [
'@nuxtjs/axios',
'@nuxtjs/dotenv',
],
/**
* Axios config
* @type {Object}
*/
axios: {
retry: {
retries: 3
},
proxyHeaders: false,
rejectUnauthorized: false
},
/*
** Customize the progress bar color
*/
loading: {
color: '#1E88E5',
failedColor: '#ba1414',
height: '5px'
},
css: [
'@/assets/sass/bootstrap.scss'
],
/**
* Custom plugins
* @type {Array}
*/
plugins: [
'~/plugins/lazy',
'~/plugins/algolia'
],
/**
* Render configuration
*/
render: {
bundleRenderer: {
gzip: {
threshold: 5
},
http2: {
push: true
}
}
},
/*
** Build configuration
*/
build: {
/*
** Run ESLint on save
*/
extractCSS: true,
extend(config, {
isDev,
isClient
}) {
if (isDev && isClient) {
config.devtool = "source-map"
config.module.rules.push({
enforce: 'pre',
test: /\.(js|vue)$/,
loader: 'eslint-loader',
exclude: /(node_modules)/
})
}
if (!isDev) {
config.plugins.push(
new PurgecssPlugin({
paths: glob.sync([
path.join(__dirname, './pages/**/*.vue'),
path.join(__dirname, './layouts/**/*.vue'),
path.join(__dirname, './components/**/*.vue'),
]),
whitelist: ["html", "body", "nuxt-loading"]
})
)
}
},
/**
* Vendor Webpack (Makes it load globally)
* @type Array
*/
vendor: ['bootstrap', 'popper.js', 'jquery', '~/plugins/global'],
}
}