view client/vue.config.js @ 500:f6d61657b487

Allow accessing client from outside localhost via hostname yarn serve only accepted IP adresses or localhost in the Host-Header before.
author Tom Gottfried <tom@intevation.de>
date Fri, 24 Aug 2018 15:17:35 +0200
parents a80e589c5ade
children 99968a7394f7
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.VUE_BACKEND_API_URL,
        secure: false
      },
      "/img/*": {
        target: "http://localhost:5000",
        secure: false
      }
    },
    disableHostCheck: true
  }
};