const path = require('path');
const common = path.resolve(__dirname, '../baoan-common');
module.exports = {
  publicPath: `/${process.env.VUE_APP_ROUTER}`,
  outputDir: process.env.VUE_APP_ROUTER,
  productionSourceMap: true,
  configureWebpack: (config) => {
    Object.assign(config, {
      resolve: {
        alias: {
          '@': path.resolve(__dirname, './src'),
          '@c': path.resolve(__dirname, './src/components'),
          '@a': path.resolve(__dirname, './src/assets'),
          '@common': common,
        },
      },
    });
  },
  devServer: {
    open: true,
    port: '11201',
    proxy: {
      '/files': {
        target: 'http://baoan.fwedzgc.com:8090',
      },
      '/api/wx': {
        target: 'http://baoan.fwedzgc.com:8090',
        changeOrigin: true,
        ws: false,
      },
      '/api/position': {
        target: 'http://baoan.fwedzgc.com:8090',
        changeOrigin: true,
        ws: false,
      },
      '/apigpy': {
        target: 'http://127.0.0.1:38088',
        changeOrigin: true,
        ws: false,
      },
      '/api/usual/sendMessage': {
        target: 'http://baoan.fwedzgc.com:8090', // http://106.12.161.200:6100
        changeOrigin: true,
        ws: false,
      },
      '/api': {
        target: 'http://baoan.fwedzgc.com:8090', // http://106.12.161.200:6100
        changeOrigin: true,
        ws: false,
      },
      // '/bio': {
      //   target: 'http://localhost:13211',
      //   changeOrigin: true,
      //   ws: false,
      // },
      // '/bio': {
      //   target: 'http://127.0.0.1:13212',
      //   changeOrigin: true,
      //   ws: false,
      // },
    },
  },
};
