You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.2 KiB

const defaultSettings = require('./src/settings.js')
const path = require('path')
const name = defaultSettings.title || 'vue Admin Template'
function resolve(dir) {
return path.join(__dirname, dir)
}
module.exports = {
publicPath: './',
outputDir: 'admin',
devServer: {
port: 3333,
open: true
// disableHostCheck: true,
// proxy: { // 配置跨域
// '/': {
// target: 'http://t.81ronggui.com:8082', // 这里后台的地址模拟的;应该填写你们真实的后台接口
// ws: false,
// changOrigin: true, // 允许跨域
// pathRewrite: {
// '^/': ''// 请求的时候使用这个api就可以
// }
// }
// }
},
lintOnSave: false,
configureWebpack: {
name: name,
resolve: {
alias: {
'@': resolve('src')
}
}
},
chainWebpack: (config) => {
config.module
.rule('svg')
.exclude.add(resolve('src/icons'))
.end()
config.module
.rule('icons')
.test(/\.svg$/)
.include.add(resolve('src/icons'))
.end()
.use('svg-sprite-loader')
.loader('svg-sprite-loader')
.options({
symbolId: 'icon-[name]'
})
.end()
}
}