-
Notifications
You must be signed in to change notification settings - Fork 4
/
nuxt.config.js
80 lines (80 loc) · 2.09 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
const path = require('path')
module.exports = {
srcDir: 'src/',
/*
** 缓存静态文件
*/
cache: false,
/*
** Headers of the page
*/
head: {
titleTemplate: '%s',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1.0, maximum-scale=1, minimum-scale=1, user-scalable=no' },
{ name: 'apple-mobile-web-app-capable', content: 'yes' },
{ name: 'apple-mobile-web-app-status-bar-style', content: 'black' },
{ name: 'format-detection', content: 'telephone=no' },
{ name: 'format-detection', content: 'email=no' }
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '//ofe0v4nhm.qnssl.com/live/icon/tinfinite-fav.png' }
],
script: [
{ src: '//o3pvuu23u.qnssl.com/ssr/js/ssr-index-baidu-hm.js' }
]
},
/**
* [将vue插件加载到全部页面中,不用在页面写if (process.BROWSER_BUILD) { ...]
* @type {Array}
*/
plugins: [
{
src: '~plugins/swiper.js',
ssr: false
}
],
css: [
'swiper/dist/css/swiper.css'
],
/*
** Customize the progress-bar color
*/
loading: { color: '#0145FF' },
/*
** 环境变量配置
*/
env: {
BUILD_ENV: process.env.BUILD_ENV
},
/*
** Build 配置
*/
build: {
publicPath: '//ofe0v4nhm.qnssl.com/',
vendor: [
'axios',
'vue-awesome-swiper'
],
/*
** webpack配置
*/
extend (config, ctx) {
config.resolve.alias['~assets'] = path.join(__dirname, 'src/assets')
config.resolve.alias['~components'] = path.join(__dirname, 'src/components')
config.resolve.alias['~pages'] = path.join(__dirname, 'src/pages')
config.resolve.alias['~plugins'] = path.join(__dirname, 'src/plugins')
config.resolve.alias['~static'] = path.join(__dirname, 'src/static')
config.resolve.alias['~store'] = path.join(__dirname, 'src/store')
if (ctx.isClient) {
config.module.rules.push({
enforce: 'pre',
test: /\.(js|vue)$/,
loader: 'eslint-loader',
exclude: /(node_modules)/
})
}
}
}
}