vue.config.js 673 字节
Newer Older
!阳仔's avatar
!阳仔 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
const { defineConfig } = require('@vue/cli-service')
const path = require('path');
function resolve(dir){
    return path.join(__dirname,dir)//设置绝对路径
}
let publicPath = '/'
if (process.env.NODE_ENV === 'production') {
  publicPath = 'https://csdn.gitcode.host/csdn-datav/'
} 
module.exports = defineConfig({
  assetsDir: 'csdn-datav',
  transpileDependencies: true,
  lintOnSave:false,
  publicPath:publicPath,
  devServer: {
    host: 'loc-csdn-datav.csdn.net',
    port: '80',
    headers: {
      'Access-Control-Allow-Origin': '*'
    }
  },
  productionSourceMap: false,
  chainWebpack: config => {
    config.resolve.alias.set('@', resolve('src'))
  }
})