Ai
1 Star 0 Fork 0

leehave/iBlog

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
nuxt.config.ts 2.73 KB
一键复制 编辑 原始数据 按行查看 历史
SkySun 提交于 2020-02-04 23:28 +08:00 . 代码优化
import fs from 'fs';
import path from 'path';
import { Configuration } from '@nuxt/types/index';
import blogConfig from './blog.config';
const server: any = {
host: blogConfig.host,
port: blogConfig.port,
timing: true
};
if (blogConfig.enableHTTPS) {
server.https = {
key: fs.readFileSync(path.resolve(__dirname, 'ssl', 'server.key')),
cert: fs.readFileSync(path.resolve(__dirname, 'ssl', 'server.crt'))
};
}
const config: Configuration = {
mode: 'universal',
/*
** Headers of the page
*/
head: {
title: 'iBlog',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{
hid: 'description',
name: 'description',
content: process.env.npm_package_description || ''
}
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }]
},
server,
serverMiddleware: ['@/server/api'],
/*
** Customize the progress-bar color
*/
loading: { color: '#f80' },
/*
** Global CSS
*/
css: [
'ant-design-vue/dist/antd.less',
'@fortawesome/fontawesome-svg-core/styles.css',
'~/static/main.css'
],
/*
** Plugins to load before mounting the App
*/
plugins: [
{ src: '@/plugins/axios', mode: 'server' },
'@/plugins/ant-design',
'@/plugins/font-awesome',
'@/plugins/web-font/index',
'@/plugins/event-bus',
{ src: '@/plugins/baidu-stats', mode: 'client' },
{ src: '@/plugins/tui-editor', mode: 'client' }
],
buildModules: ['@nuxt/typescript-build'],
/*
** Nuxt.js modules
*/
modules: [
'@nuxtjs/axios',
'@nuxtjs/auth',
'@nuxtjs/pwa'
],
auth: {
strategies: {
local: {
endpoints: {
login: {
url: '/api/auth/login',
method: 'post',
propertyName: 'token.accessToken'
},
logout: { url: '/api/auth/logout', method: 'post' },
user: { url: '/api/auth/user', method: 'get', propertyName: 'user' }
}
}
},
redirect: {
login: '/auth/login',
logout: '/',
callback: '/auth/login',
home: '/'
}
},
/*
** Axios module configuration
** See https://axios.nuxtjs.org/options
*/
axios: {
baseURL: `${blogConfig.enableHTTPS ? 'https' : 'http'}://127.0.0.1:${blogConfig.port}`,
browserBaseURL: '/'
},
/*
** Build configuration
*/
build: {
/*
** You can extend webpack config here
*/
extend () {},
loaders: {
less: {
modifyVars: {
// 'font-size-base': '16px',
'outline-width': '0'
},
javascriptEnabled: true
}
}
},
typescript: {
typeCheck: {
eslint: true
}
},
watch: ['~/server']
};
export default config;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/code-lzx/iBlog.git
git@gitee.com:code-lzx/iBlog.git
code-lzx
iBlog
iBlog
master

搜索帮助