Commit adf8c07b authored by 杨贺晨吉's avatar 杨贺晨吉

feat: 1;

parent a0021f54
...@@ -13,7 +13,6 @@ const resolve = dir => { ...@@ -13,7 +13,6 @@ const resolve = dir => {
* 我们可以根据环境变量进行相应的处理,只有在产品的时候,才让插件去自动注入相应的资源文件到html页面 * 我们可以根据环境变量进行相应的处理,只有在产品的时候,才让插件去自动注入相应的资源文件到html页面
*/ */
const enableProduction = process.env.NODE_ENV === "prod"; // 是否生产环境 const enableProduction = process.env.NODE_ENV === "prod"; // 是否生产环境
let externals = { let externals = {
vue: "Vue", vue: "Vue",
axios: "axios", axios: "axios",
...@@ -80,11 +79,10 @@ module.exports = { ...@@ -80,11 +79,10 @@ module.exports = {
} }
}, },
devServer: { devServer: {
open: true,
port: configs.port, port: configs.port,
proxy: { proxy: {
"/": { "/": {
target: 'http://robot.tuiatest.cn', target: 'https://mall.jiliang666.com',
changeOrigin: true, changeOrigin: true,
// 只需要添加该方法,然后当请求的是html,则重定向到index.html // 只需要添加该方法,然后当请求的是html,则重定向到index.html
bypass: function (req, res, proxyOptions) { bypass: function (req, res, proxyOptions) {
...@@ -115,12 +113,11 @@ module.exports = { ...@@ -115,12 +113,11 @@ module.exports = {
threshold: 10240 // 对超过10k文件压缩 threshold: 10240 // 对超过10k文件压缩
}) })
], ],
output: enableProduction ? { output: {
path: path.resolve(__dirname, 'dist/'), path: path.resolve(__dirname, 'dist/'),
filename: 'assets/js/[name].[hash].js', filename: 'assets/js/[name].[hash].js',
chunkFilename: 'assets/js/[name].[hash].js' chunkFilename: 'assets/js/[name].[hash].js'
} : {}, },
optimization: { optimization: {
runtimeChunk: "single", runtimeChunk: "single",
minimizer: jsPlugin, minimizer: jsPlugin,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment