view client/vue.config.js @ 329:71970f03c9e8

SPA: Fixed setup for proxy in "serve" dev server mode.
author Sascha Wilde <wilde@intevation.de>
date Fri, 03 Aug 2018 10:52:03 +0200
parents c1ef0be0ae3d
children a80e589c5ade
line wrap: on
line source

var CopyWebpackPlugin = require("copy-webpack-plugin");

module.exports = {
  outputDir: "../web",
  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
      });
  },
  devServer: {
    proxy: {
      "/api": {
        target: process.env.BACKEND_API_URL,
        secure: false
      },
      "/img/*": {
        target: "http://localhost:5000",
        secure: false
      }
    }
  }
};