let targetUrl = 'http://mteadev.dayaedu.com'
// let targetUrl = 'http://dyme.utools.club'
// let targetUrl = 'https://online.dayaedu.com'
// let targetUrl = 'http://testadm.dayaedu.com/'
// let targetUrl = 'http://192.168.3.48:8080'
module.exports = {
  publicPath: './',
  // 生产环境 sourceMap
  productionSourceMap: false,
  // 调整内部的 webpack 配置。
  // 查阅 https://github.com/vuejs/vue-doc-zh-cn/vue-cli/webpack.md
  chainWebpack: config => {
    config.plugin('html').tap(args => {
      args[0].minify = {
        removeAttributeQuotes: false
      }
      return args
    })
  },
  configureWebpack: () => { },
  // 配置 webpack-dev-server 行为。
  devServer: {
    open: process.platform === 'darwin',
    host: '0.0.0.0',
    port: 9999,
    https: false,
    hotOnly: false,
    // 查阅 https://github.com/vuejs/vue-doc-zh-cn/vue-cli/cli-service.md#配置代理
    proxy: {
      '/contracts': {
        target: targetUrl,
        changeOrigin: true,
        ws: true,
        '^/contracts': '/contracts',
        xfwd: true
      },
      '/api-student': {
        target: targetUrl,
        changeOrigin: true,
        ws: true,
        '^/api-student': '/api-student',
        xfwd: true
      },
      '/api-cms': {
        target: targetUrl,
        changeOrigin: true,
        ws: true,
        '^/api-cms': '/api-cms',
        xfwd: true
      },
      '/api-teacher': {
        target: targetUrl,
        changeOrigin: true,
        ws: true,
        '^/api-teacher': '/api-teacher',
        xfwd: true
      },
      '/api-web': {
        target: targetUrl,
        changeOrigin: true,
        ws: true,
        '^/api-web': '/api-web',
        xfwd: true
      },
      '/api-auth': {
        target: targetUrl,
        changeOrigin: true,
        ws: true,
        '^/api-auth': '/api-auth',
        xfwd: true
      }
    }, // string | Object
  },
  css: {
    loaderOptions: {
      less: {
        modifyVars: {
          // red: '#03a9f4',
          blue: '#14928A',
          // orange: '#f08d49',
          // 'text-color': '#111'
        }
      }
    }
  },
}