|
@@ -1,32 +1,21 @@
|
|
-var webpack = require("webpack");
|
|
|
|
var TerserPlugin = require("terser-webpack-plugin");
|
|
var TerserPlugin = require("terser-webpack-plugin");
|
|
-var devProxy = {};
|
|
|
|
-try {
|
|
|
|
- devProxy = require("./dev-proxy");
|
|
|
|
-} catch (error) {}
|
|
|
|
|
|
+var devProxy = {
|
|
|
|
+ "/api/": {
|
|
|
|
+ target: process.env.VUE_APP_DEV_PROXY,
|
|
|
|
+ changeOrigin: true
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
|
|
-var proxy = process.env.NODE_ENV === "production" ? {} : devProxy;
|
|
|
|
|
|
|
|
// 配置手册: https://cli.vuejs.org/zh/config/#vue-config-js
|
|
// 配置手册: https://cli.vuejs.org/zh/config/#vue-config-js
|
|
var config = {
|
|
var config = {
|
|
// publicPath: './',
|
|
// publicPath: './',
|
|
devServer: {
|
|
devServer: {
|
|
- port: 8058
|
|
|
|
|
|
+ port: 8055,
|
|
|
|
+ proxy: devProxy
|
|
},
|
|
},
|
|
chainWebpack: config => {
|
|
chainWebpack: config => {
|
|
// webpack-chain配置手册:github.com/neutrinojs/webpack-chain#getting-started
|
|
// webpack-chain配置手册:github.com/neutrinojs/webpack-chain#getting-started
|
|
- config.plugin("provide").use(webpack.ProvidePlugin, [
|
|
|
|
- {
|
|
|
|
- "window.Quill": "quill/dist/quill.js",
|
|
|
|
- Quill: "quill/dist/quill.js"
|
|
|
|
- }
|
|
|
|
- ]);
|
|
|
|
- // 限制base64图片的大小在20kb以下
|
|
|
|
- config.module
|
|
|
|
- .rule("images")
|
|
|
|
- .use("url-loader")
|
|
|
|
- .loader("url-loader")
|
|
|
|
- .tap(options => Object.assign(options, { limit: 20480 }));
|
|
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
@@ -43,8 +32,5 @@ if (process.env.NODE_ENV === "production") {
|
|
};
|
|
};
|
|
}
|
|
}
|
|
|
|
|
|
-if (proxy && Object.keys(proxy).length) {
|
|
|
|
- config.devServer.proxy = proxy;
|
|
|
|
-}
|
|
|
|
|
|
|
|
module.exports = config;
|
|
module.exports = config;
|