const { defineConfig } = require('@vue/cli-service')
const path = require('path')

module.exports = defineConfig({
  productionSourceMap: false,
  // publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
  publicPath: '/',
  configureWebpack: {
    resolve: {
      alias: {
        '@': path.join(__dirname, './src/')
      }
    },
  },

  css: {
    loaderOptions: {
      less: {
        lessOptions: {
          // 如果需要在全局引入变量文件，可以在此处添加
          // modifyVars: {
          //   '@primary-color': '#1DA57A'
          // }
        }
      }
    }
  },
  pluginOptions: {
    'style-resources-loader': {
      preProcessor: 'scss',
      patterns: []
    }
  },

  chainWebpack: config => {
    config.module
      .rule('scss')
      .use('sass-loader')
      .loader('sass-loader')
      .end()
  },
  devServer: {
    hot: true,
    proxy: {
      '/Api': {
        target: 'https://app.gter.net',//请求的接口的前缀
        changeOrigin: true,
        ws: true,  //用于支持websocket
        rewrite: (path) => path.replace(/^\/Api/, ''),
        pathRewrite: {
          '^/Api': ''
        }
      }
    }
  },




})