var HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path')
const isProdMode = Object.is(process.env.NODE_ENV, 'production')
const baseUrl = process.env.BASE_URL || (isProdMode ? 'https://sso.ubtob.com/' : 'https://test-sso-server.uuzcc.cn/')
module.exports = {
router: {
middleware: 'check-auth'
},
transition: {
name: 'fade',
mode: 'out-in'
},
/*
** Headers of the page
*/
head: {
title: '账户中心',
meta: [{
charset: 'utf-8'
},
{
'http-equiv': 'X-UA-Compatible',
content: 'IE=edge,chrome=1'
},
{
name: 'render',
content: 'webkit'
},
{
name: 'viewport',
content: 'width=device-width, initial-scale=1'
},
{
hid: 'description',
name: 'description',
content: '账户中心'
}
],
link: [{
rel: 'icon',
type: 'image/x-icon',
href: '/U.png'
}]
},
/*
** Customize the progress-bar color
*/
loading: '~components/common/nuxt-loading/Loading.vue',
/*
** Build configuration
*/
build: {
/*
** Run ESLINT on save
*/
extractCSS: {
allChunks: true
},
extend(config, {
dev,
isClient,
isServer
}) {
Object.assign(config.resolve.alias, {
'~utils': path.resolve(__dirname, 'utils'),
'~components': path.join(__dirname, 'components'),
'~assets': path.join(__dirname, 'assets'),
'~plugins': path.join(__dirname, 'plugins'),
'~store': path.join(__dirname, 'store')
})
// console.log( config.plugins)
// config.plugins.push(new HtmlWebpackPlugin({
// title: 'React Title !',
// template: './app.html',
// minify: {
// removeAttributeQuotes: true
// },
// inject: 'body'
// }))
// config.resolve.alias['~utils'] = path.join(__dirname, 'utils')
// config.resolve.alias['~components'] = path.join(__dirname, 'components')
// config.resolve.alias['assets'] = path.join(__dirname, './assets')
// config.resolve.alias['~plugins'] = path.join(__dirname, 'plugins')
// config.resolve.alias['~store'] = path.join(__dirname, 'store')
// config.module.rules.push({
// test: /\.scss$/,
// loader: 'vue-style-loader!css-loader!sass-loader'
// })
// config.module.rules.push({
// test: /\.js$/,
// loader: 'babel-loader'
// })
// if (isClient) {
// config.module.rules.push({
// enforce: 'pre',
// test: /\.(js|vue)$/,
// loader: "eslint-loader",
// exclude: /node_modules/
// })
// }
},
vendor: [
'axios',
'element-ui',
'mint-ui',
'vuerify',
'vee-validate'
],
// babel: {
// presets: ['es2015', 'stage-2'],
// plugins: [
// 'transform-async-to-generator',
// 'transform-runtime'
// ],
// comments: true
// },
// postcss: [
// require('autoprefixer')({
// browsers: ['last 3 versions']
// })
// ]
},
css: [{
src: '~assets/scss/mobileCommon.scss',
lang: 'scss'
},
{
src: '~assets/scss/app.scss',
lang: 'scss'
}
],
dev: !isProdMode,
env: {
baseUrl,
},
plugins: [
// {
// src: '~plugins/axios-nuxt.js'
// },
// {
// src: '~plugins/axios.js'
// },
{
src: '~plugins/element-ui.js'
}, {
src: '~plugins/mint-ui.js'
}, {
src: '~plugins/filters.js',
ssr: false
}, {
src: '~plugins/jsonp.js',
ssr: false
}, {
src: '~plugins/vuerify.js',
ssr: false
}, {
src: '~plugins/vee-validate.js',
ssr: true
}
],
/* TODO 代理 */
proxyTable: ['/api/**', '/login/**', '/user**', '/logout**', '/sso/**', '/appeal/**', '/update/user/**', '/valid/**', '/im/**', '/weChat/**', '/bh/**', '/foreign/**']
}