7 Star 66 Fork 10

fy/Icarus

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
nuxt.config.js 3.08 KB
一键复制 编辑 原始数据 按行查看 历史
fy 提交于 2019-04-07 23:28 . 移动端效果修复
const path = require('path')
const pkg = require('./package')
const webpack = require('webpack')
const mm = require('micromatch')
module.exports = {
mode: 'universal',
srcDir: 'src/',
/*
** Headers of the page
*/
head: {
title: pkg.name,
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: pkg.description }
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
]
},
/*
** Customize the progress-bar color
*/
loading: { color: '#3397dc' },
/*
** Global CSS
*/
css: [
// '@/assets/css/variables.scss',
// '@/assets/css/input.scss'
],
/** middleware */
serverMiddleware: [
{
handler: function (req, res, next) {
// 注:此处从简,因为例如/search*明显匹配了更多url,但并非关键
let spaPaths = [
'/account/**',
'/notifications',
'/notifications*',
'/notifications/**',
'/admin/**',
'/wiki/new',
'/wiki/new*',
'/wiki/edit/**',
'/setting/**',
'/search*',
'/search/**'
]
if (mm.some(req._parsedUrl.pathname, spaPaths)) {
res.spa = true
}
next()
}
}
],
/** middleware */
router: {
middleware: ['router-guards']
},
/*
** Plugins to load before mounting the App
*/
plugins: [
'@/plugins/_main',
'@/plugins/helpers',
'@/plugins/api',
'@/plugins/message'
],
/*
** Nuxt.js modules
*/
modules: [
'@nuxtjs/router',
'@nuxtjs/style-resources',
'nuxt-universal-storage'
],
storage: {
},
styleResources: {
scss: [
'@/assets/css/variables.scss',
'@/assets/css/response.scss',
'@/assets/css/input.scss'
]
},
/*
** Build configuration
*/
build: {
/*
** You can extend webpack config here
*/
postcss: {
plugins: {
autoprefixer: {}
}
},
plugins: [
new webpack.ProvidePlugin({
'_': path.resolve(__dirname, './src/tools/lodash.js')
}),
new webpack.ProvidePlugin({
'$': path.resolve(__dirname, './src/tools/_merge.js')
})
],
extend (config, ctx) {
// Run ESLint on save
if (ctx.isDev && ctx.isClient) {
config.module.rules.push({
enforce: 'pre',
test: /\.(js|vue)$/,
loader: 'eslint-loader',
exclude: /(node_modules)/
})
}
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/fy0/Icarus.git
[email protected]:fy0/Icarus.git
fy0
Icarus
Icarus
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385