blog-client/nuxt.config.js

122 lines
2.2 KiB
JavaScript
Raw Normal View History

2019-02-07 16:26:17 +08:00
const pkg = require('./package')
2019-02-07 17:03:39 +08:00
const DevBaseUrl = 'http://127.0.0.1:65534'
const ProdBashUrl = 'https://api.wyr.me'
2019-02-07 16:26:17 +08:00
module.exports = {
mode: 'universal',
/*
2019-02-07 17:03:39 +08:00
** Headers of the page
*/
2019-02-07 16:26:17 +08:00
head: {
2019-02-07 17:03:39 +08:00
title: '轶哥博客',
htmlAttrs: {
lang: 'zh-cn'
},
meta: [{
charset: 'utf-8'
},
{
name: 'viewport',
content: 'width=device-width, initial-scale=1, user-scalable=no'
},
{
'http-equiv': 'X-UA-Compatible',
content: 'IE=edge, chrome=1'
},
{
hid: 'description',
name: 'description',
content: '一个全栈程序员的技术博客。'
2019-04-18 10:45:33 +08:00
},
{
hid: 'keywords',
name: 'keywords',
content: '轶哥,王轶,全栈,程序员,技术博客'
2019-02-07 17:03:39 +08:00
}
2019-02-07 16:26:17 +08:00
],
2019-02-07 17:03:39 +08:00
link: [{
rel: 'stylesheet',
href: 'https://cdn.wyr.me/css/begin.css'
},
{
rel: 'stylesheet',
href: 'https://cdn.wyr.me/css/highlight/atom-one-light.css'
},
{
rel: 'icon',
type: 'image/x-icon',
href: '/favicon.ico'
}
2019-02-07 16:26:17 +08:00
]
},
/*
2019-02-07 17:03:39 +08:00
** Customize the progress-bar color
*/
loading: {
color: '#3B8070'
},
2019-02-07 16:26:17 +08:00
/*
2019-02-07 17:03:39 +08:00
** Global CSS
*/
css: [],
2019-02-07 16:26:17 +08:00
/*
2019-02-07 17:03:39 +08:00
** Plugins to load before mounting the App
*/
plugins: [{
src: '~/plugins/moment.js'
},
{
src: '~/plugins/vue.js',
ssr: true
},
{
src: '~/plugins/browser.js',
ssr: false
}
2019-02-07 16:26:17 +08:00
],
/*
2019-02-07 17:03:39 +08:00
** Nuxt.js modules
*/
2019-02-07 16:26:17 +08:00
modules: [
// Doc: https://axios.nuxtjs.org/usage
'@nuxtjs/axios'
],
/*
2019-02-07 17:03:39 +08:00
** Axios module configuration
*/
2019-02-07 16:26:17 +08:00
axios: {
// See https://github.com/nuxt-community/axios-module#options
2019-02-07 17:03:39 +08:00
baseURL: process.env.NODE_ENV === 'development' ? DevBaseUrl : ProdBashUrl // 配置API接口地址
2019-02-07 16:26:17 +08:00
},
/*
2019-02-07 17:03:39 +08:00
** Build configuration
*/
2019-02-07 16:26:17 +08:00
build: {
/*
2019-02-07 17:03:39 +08:00
** You can extend webpack config here
*/
2019-03-24 00:15:54 +08:00
extend(config, ctx) {
2019-02-07 16:26:17 +08:00
// Run ESLint on save
if (ctx.isDev && ctx.isClient) {
config.module.rules.push({
enforce: 'pre',
test: /\.(js|vue)$/,
loader: 'eslint-loader',
exclude: /(node_modules)/
})
}
2019-02-07 17:03:39 +08:00
},
vendor: ['moment']
},
env: {
version: pkg.version
2019-02-07 16:26:17 +08:00
}
}