Просмотр исходного кода

Merge branch 'master' of https://git.agilestar.cn/spfm-group/spfm-market-front

mll 3 лет назад
Родитель
Сommit
8bee133dd8
5 измененных файлов с 50 добавлено и 26 удалено
  1. 2 0
      .env.development
  2. 2 0
      .env.production
  3. BIN
      dist.zip
  4. 1 1
      package.json
  5. 45 25
      vue.config.js

+ 2 - 0
.env.development

@@ -0,0 +1,2 @@
+VUE_APP_FILE_API = http://192.168.1.9:9114
+VUE_APP_GRID_API = http://192.168.1.19:9114

+ 2 - 0
.env.production

@@ -0,0 +1,2 @@
+VUE_APP_FILE_API =
+VUE_APP_GRID_API =


+ 1 - 1
package.json

@@ -25,6 +25,7 @@
     "luckyexcel": "^1.0.1",
     "moment": "^2.29.1",
     "qs": "^6.9.1",
+    "sass": "^1.46.0",
     "tinymce": "^5.7.1",
     "vue": "^2.6.11",
     "vue-axios": "^2.1.5",
@@ -44,7 +45,6 @@
     "compression-webpack-plugin": "^3.0.1",
     "eslint": "^5.16.0",
     "eslint-plugin-vue": "^5.0.0",
-    "node-sass": "^4.14.1",
     "sass-loader": "^8.0.0",
     "script-loader": "^0.7.2",
     "vue-template-compiler": "^2.6.11",

+ 45 - 25
vue.config.js

@@ -1,31 +1,34 @@
-const CompressionPlugin = require('compression-webpack-plugin');
-const webpack = require('webpack');
-const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
+const CompressionPlugin = require("compression-webpack-plugin");
+const webpack = require("webpack");
+const BundleAnalyzerPlugin =
+    require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
 module.exports = {
-    publicPath: process.env.NODE_ENV === 'production' ? '' : '/',
+    publicPath: process.env.NODE_ENV === "production" ? "" : "/",
     productionSourceMap: false,
     lintOnSave: false,
 
-    chainWebpack: config => {
-        if (process.env.NODE_ENV === 'production') {
+    chainWebpack: (config) => {
+        if (process.env.NODE_ENV === "production") {
             if (process.env.npm_config_report) {
                 config
-                    .plugin('webpack-bundle-analyzer')
-                    .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin)
+                    .plugin("webpack-bundle-analyzer")
+                    .use(
+                        require("webpack-bundle-analyzer").BundleAnalyzerPlugin
+                    );
             }
-            config.plugins.delete('prefetch');
+            config.plugins.delete("prefetch");
         }
     },
-    configureWebpack: config => {
-        if (process.env.NODE_ENV === 'production') {
+    configureWebpack: (config) => {
+        if (process.env.NODE_ENV === "production") {
             config.optimization = {
                 splitChunks: {
-                    chunks: "all",          //async异步代码分割 initial同步代码分割 all同步异步分割都开启
-                    minSize: 10000,         //字节 引入的文件大于30kb才进行分割
+                    chunks: "all", //async异步代码分割 initial同步代码分割 all同步异步分割都开启
+                    minSize: 10000, //字节 引入的文件大于30kb才进行分割
                     // minChunks: 2,           //模块至少使用次数
                     // maxAsyncRequests: 25,    //同时加载的模块数量最多是5个,只分割出同时引入的前5个文件
                     // maxInitialRequests: 30,  //首页加载的时候引入的文件最多3个
-                    automaticNameDelimiter: '-', //缓存组和生成文件名称之间的连接符
+                    automaticNameDelimiter: "-", //缓存组和生成文件名称之间的连接符
                     // name: true,                  //缓存组里面的filename生效,覆盖默认命名
                     cacheGroups: {
                         // vue: {
@@ -53,9 +56,9 @@ module.exports = {
                         //     test: /[\\\/]node_modules[\\\/]/,
                         //     priority: -20
                         // },
-                    }
-                }
-            }
+                    },
+                },
+            };
             // return {
             //     plugins: [
             //         new CompressionPlugin({
@@ -83,25 +86,42 @@ module.exports = {
             //     // new BundleAnalyzerPlugin()
             // ]
         }
-
     },
     parallel: true,
 
     devServer: {
         proxy: {
-            '/': {
+            // 开发环境变化可注释 ⬇️⬇️
+            "/market/CMK": {
+                target: "http://192.168.1.9:9114",
+                ws: false,
+                changeOrigin: true,
+                pathRewrite: {
+                    "^/market": "",
+                },
+            },
+            "/mkWangge": {
+                target: "http://192.168.1.19:9114",
+                ws: false,
+                changeOrigin: true,
+                pathRewrite: {
+                },
+            },
+            // 开发环境变化可注释 ⬆️⬆️
+            "/": {
                 // target: 'http://192.168.2.145:9600/spfm',
                 // target: 'http://192.168.2.149:9600',
                 // target: 'http://10.64.42.70:8088/',
                 // target: 'http://114.215.71.182:29600',
-                target: 'http://192.168.1.9:9600/spfm',
+                // target: 'http://192.168.1.9:9600/spfm',
                 // target: 'http://127.0.0.1:9600/',
                 // target: 'http://192.168.0.156:9600/',
                 // target: 'http://192.168.2.170:9600/',
                 // target: 'http://192.168.2.169:9600/',
-                changeOrigin: true
-            }
-        }
+                target: "http://192.168.1.228:9600/spfm",
+                changeOrigin: true,
+            },
+        },
     },
-    transpileDependencies: ['color-string'] // 此段为增加配置选项
-}
+    transpileDependencies: ["color-string"], // 此段为增加配置选项
+};