1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- const webpack = require("webpack");
- const path = require("path");
- const CompressionWebpackPlugin = require("compression-webpack-plugin");
- let env = process.env.NODE_ENV;
- module.exports = {
-
- publicPath: env !== "development" ? "./" : "/",
-
-
-
-
- assetsDir: "assets",
-
- runtimeCompiler: true,
-
- productionSourceMap: env !== "development" ? false : true,
-
- outputDir: "dist",
-
- css: {
- sourceMap: true
- },
- devServer: {
- port: 8083,
- host: "0.0.0.0",
- hot: true,
- open: false,
- disableHostCheck: true,
- proxy: {
- "/api": {
- target: "127.0.0.1",
- changeOrigin: true,
- ws: false,
- pathRewrite: {
- "^/api": ""
- }
- },
- '/restfull': {
- target: "http://192.168.0.238:8033",
- changeOrigin: true,
- pathRewrite: {
- '^/restfull': ''
- }
- },
- }
- },
- chainWebpack: config => {
- config.resolve.alias.set("@", path.resolve(__dirname, "./src"));
- },
- configureWebpack: config => {
- if (env !== "development") {
-
- config.plugins.push(
- new CompressionWebpackPlugin({
- algorithm: "gzip",
- test: /\.js$|\.html$|.\css/,
- threshold: 10240,
- deleteOriginalAssets: false,
- minRatio: 0.8
- })
- );
- }
- }
- };
|