view client/vue.config.js @ 3703:b07511ff859e

Don't include calculated area in unchanged bottleneck detection. This makes BN imports considerably faster. The only downside is, that when die waterway area changes there is no easy way to recalculate the areas of existing BN. But the semantics in that case are somewhat hard anyway (think of historization for the old area) so this should be ok.
author Sascha Wilde <wilde@intevation.de>
date Wed, 19 Jun 2019 12:34:48 +0200
parents 89b38d7e7b6a
children 84d01a536bec
line wrap: on
line source

const CopyWebpackPlugin = require("copy-webpack-plugin");
module.exports = {
  outputDir: "../web",
  configureWebpack: {
    devtool: "source-map"
  },
  chainWebpack: config => {
    let vendorImgPath = process.env.VUE_APP_VENDOR_IMG_PATH;
    if (!vendorImgPath) return;
    config
      .plugin("CopyWebpackPlugin")
      .use(CopyWebpackPlugin, [[{ from: vendorImgPath, to: "img" }]], {
        copyUnmodified: true
      });
    if (process.env.ANALYZE) {
      var BundleAnalyzerPlugin = require("webpack-bundle-analyzer")
        .BundleAnalyzerPlugin;
      config.plugin("BundleAnalyzerPlugin").use(BundleAnalyzerPlugin, []);
    }
  },
  css: {
    loaderOptions: {
      // pass options to sass-loader
      sass: {
        // @/ is an alias to src/
        data: `@import "@/assets/application.scss";`
      }
    }
  },
  devServer: {
    proxy: {
      "/api": {
        target: process.env.VUE_BACKEND_API_URL,
        secure: false
      },
      "/img/*": {
        target: "http://localhost:5000",
        secure: false
      }
    },
    disableHostCheck: true
  }
};