-
Notifications
You must be signed in to change notification settings - Fork 0
/
nuxt.config.js
76 lines (71 loc) · 2.29 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
export default {
// Global page headers (https://go.nuxtjs.dev/config-head)
head: {
title: 'javascript技术分享-书写心得,分享感悟',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ 'http-equiv': 'content-language', content: 'zh-cn' },
{ hid: 'description', name: 'description', content: '书写心得,分享感悟。' },
{ hid: 'keywords', name: 'keywords', content: 'javascript技术分享,js技术,vuejs,web前端,前端开发,前端面试,web开发,dsiab,个人博客,前端博客' },
// { name: 'referrer', content: 'no-referrer-when-downgrade' }, // 解决其他开启网站防盗链功能,全局会导致百度统计失效
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
]
},
// server: {
// port: 3000,
// host: "0.0.0.0" // 默认为当前ip
// },
// Global CSS (https://go.nuxtjs.dev/config-css)
css: [
'./assets/css/common.css',
'element-ui/lib/theme-chalk/index.css'
],
// Plugins to run before rendering page (https://go.nuxtjs.dev/config-plugins)
plugins: [
'@/plugins/element-ui',
{ src: './plugins/tongji.js' }
],
// Auto import components (https://go.nuxtjs.dev/config-components)
components: true,
// Modules for dev and build (recommended) (https://go.nuxtjs.dev/config-modules)
buildModules: [
// https://go.nuxtjs.dev/eslint
// '@nuxtjs/eslint-module',
],
// Modules (https://go.nuxtjs.dev/config-modules)
modules: [
'@nuxtjs/proxy',
'@nuxtjs/component-cache',
// 缓存配置选项
['@nuxtjs/component-cache', {
max: 10000,
maxAge: 1000 * 60 * 60
}]
],
hooks:{
// 去除window._nuxt文件
// 'vue-renderer:ssr:context'(context){
// const routePath = JSON.stringify(context.nuxt.routePath)
// context.nuxt = {serverRendered: true,routePath}
// }
},
axios: {
proxy: true
},
proxy: {
'/bootService': {
// target: 'http://localhost:8091/'
target: 'http://admin.dsiab.com/'
}
},
// Build Configuration (https://go.nuxtjs.dev/config-build)
build: {
transpile: [/^element-ui/],
cssSourceMap: false,
extractCSS: true, // 将页面css单独打包
},
loading: '~/components/common/loading.vue'
}