view client/vue.config.js @ 1459:18ddb6935aa6

purgecss ate toast
author Thomas Junk <thomas.junk@intevation.de>
date Mon, 03 Dec 2018 12:42:21 +0100
parents ef388dcbb946
children eb832d81b67a
line wrap: on
line source

const 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
      });
  },
  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
  }
};