
const path = require('path');

function resolve (dir) {
  return path.join(__dirname, dir);
}

module.exports = {
  productionSourceMap: false,
  publicPath: './',
  devServer: {
    proxy: {
      '/': {
        target: 'http://gicdev.demogic.com/',
        changeOrigin: true,
        cookieDomainRewrite: {
            '*': 'localhost',
          },
          cookiePathRewrite: {
            '*': '/',
          },
      },
    },
  },
  css: {
    loaderOptions: {
      scss: {
        sassOptions: { outputStyle: 'expanded' }, // 避免默认compressed打包输出双字节字符造成icon乱码
      },
    },
  },
  configureWebpack: config => {
    config.externals = {
      vue: 'Vue',
      'vue-router': 'VueRouter',
      axios: 'axios',
    };
  },
  chainWebpack: (config) => {
    config.resolve.alias
      .set('@', resolve('src'));
  },
};
