-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnuxt.config.js
55 lines (55 loc) · 1.72 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
module.exports = {
head: {
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ name: 'renderer', content: 'webkit' },
{ hid: 'keywords', name: 'keywords', content: 'VueBlog, Vuejs, Nodejs, 服务端渲染'},
{ hid: 'description', name: 'description', content: 'VueBlog是一个基于Vuejs开发的小型博客应用,让你可以为所欲为的分享自己的知识和创作'}
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
{ rel: 'alternate', type: 'application/rss+xml', title: 'RSS 2.0', href: '/rss.xml' },
{ rel: 'stylesheet', type: 'text/css', href: '//at.alicdn.com/t/font_620064_hrymm1e94nnlv7vi.css' }
]
},
css: ['~assets/css/main.scss', 'highlight.js/styles/github.css'],
loading: { color: '#42B983' },
build: {
vendor: ['axios'],
extend(config, ctx) {
if (ctx.isClient) {
config.module.rules.push({
enforce: 'pre',
test: /\.(js|vue)$/,
loader: 'eslint-loader',
exclude: /(node_modules)/
})
}
}
},
manifest: {
name: 'VueBlog',
description: 'A blog system',
theme_color: '#42B983'
},
modules: [
// '@nuxtjs/axios',
['@nuxtjs/proxy', { pathRewrite: { '^/api' : 'api' } }],
],
plugins: [
'~/plugins/components.js',
'~/plugins/filters.js',
{ src: '~/plugins/localStorage.js', ssr: false },
{ src: '~plugins/http', ssr: true }
],
proxy: [
['/api',
{
target: 'http://127.0.0.1:3010',
secure: false,
changeOrigin: true, // 这个属性去了就404,具体原因不详
cookieDomainRewrite: '0.0.0.0'
}]
]
}