const  path=require('path')
function resolve(dir) {
  console.log(dir)
  console.log(__dirname)
  console.log(path)
  return path.join(__dirname, dir);
}
module.exports = {
  productionSourceMap: false,
  assetsDir: "s",
  lintOnSave: false,
  devServer: {
    inline: true,
    disableHostCheck: true,
    port: 8085,
    hot: true, //自动保存
    proxy: {
      "/m": {
       // target: "http://192.168.0.98:11019",
        //target: 'http://127.0.0.1:18001',
       // target: 'http://192.168.0.250:18001',
        target: 'http://8.136.255.30:1101',
        changeOrigin: true,
        secure: false
      },
      "/file/fileupload/": {
        // target: "http://192.168.0.98:11019",
        //target: 'http://127.0.0.1:18001',
        //target: 'http://192.168.0.250:1101',
        target: 'http://8.136.255.30:1101',
        changeOrigin: true,
        secure: false
      },
      "/file/preview/": {
        // target: "http://192.168.0.98:11019",
        //target: 'http://127.0.0.1:18001',
        //target: 'http://192.168.0.250:1101',
        target: 'http://8.136.255.30:1101',
        changeOrigin: true,
        secure: false
      }

      ///file/preview/
    },
  },

  chainWebpack: (config) => {
    // 配置 svg-sprite-loader
    config.module
        .rule("svg")
        .exclude.add(resolve("src/icons"))
        .end();
    config.module
        .rule("icons")
        .test(/\.svg$/)
        .include.add(resolve("src/icons"))
        .end()
        .use("svg-sprite-loader")
        .loader("svg-sprite-loader")
        .options({
          symbolId: "icon-[name]",
        })
        .end();
  },
};
