const defProxy = {
  "/api": {
    target: process.env.VUE_APP_MAIN_PROXY,
    changeOrigin: true,
  },
  "/file": {
    target: process.env.VUE_APP_MAIN_PROXY_FILE,
    changeOrigin: true,
  },
};

var webpack = require("webpack");
module.exports = {
  lintOnSave: process.env.NODE_ENV !== "production" ? true : "error",
  devServer: {
    proxy: defProxy,
  },
  configureWebpack: {
    devtool: "source-map",
    plugins: [
      // Ignore all locale files of moment.js
      // TODO: use webpack stats to check if iview locale matters
      new webpack.IgnorePlugin(/^\.\/locale$/, /moment|iview$/),
    ],
  },
  transpileDependencies: [/\bvue-awesome\b/],
};
