|
|
@@ -29,21 +29,21 @@ export default defineConfig(({ mode, command }) => {
|
|
|
// 最小化拆分包
|
|
|
manualChunks(id) {
|
|
|
if (id.includes("node_modules")) {
|
|
|
- if (id.includes("node_modules/element-plus")) {
|
|
|
- return "vb_plugin_element-plus"
|
|
|
- }
|
|
|
- if (id.includes("node_modules/nprogress")) {
|
|
|
- return "vb_plugin_nprogress" //单独打包
|
|
|
- }
|
|
|
- if (id.includes("node_modules/quill")) {
|
|
|
- return "vb_plugin_quill"
|
|
|
- }
|
|
|
- if (id.includes("node_modules/echarts")) {
|
|
|
- return "vb_plugin_echarts"
|
|
|
- }
|
|
|
- if (id.includes("node_modules/lodash")) {
|
|
|
- return "vb_plugin_lodash"
|
|
|
- }
|
|
|
+ // if (id.includes("node_modules/element-plus")) {
|
|
|
+ // return "vb_plugin_element-plus"
|
|
|
+ // }
|
|
|
+ // if (id.includes("node_modules/nprogress")) {
|
|
|
+ // return "vb_plugin_nprogress" //单独打包
|
|
|
+ // }
|
|
|
+ // if (id.includes("node_modules/quill")) {
|
|
|
+ // return "vb_plugin_quill"
|
|
|
+ // }
|
|
|
+ // if (id.includes("node_modules/echarts")) {
|
|
|
+ // return "vb_plugin_echarts"
|
|
|
+ // }
|
|
|
+ // if (id.includes("node_modules/lodash")) {
|
|
|
+ // return "vb_plugin_lodash"
|
|
|
+ // }
|
|
|
// 通过拆分包的方式将所有来自node_modules的模块打包到单独的chunk中
|
|
|
return "vb_plugin_vendor"
|
|
|
}
|
|
|
@@ -51,9 +51,9 @@ export default defineConfig(({ mode, command }) => {
|
|
|
if (id.includes(resolve(__dirname, "/src/stores/index.ts"))) {
|
|
|
return "vb_store"
|
|
|
}
|
|
|
- if (id.includes("/src/components/") && id.includes("/Vb")) {
|
|
|
- return "vb_components"
|
|
|
- }
|
|
|
+ // if (id.includes("/src/components/") && id.includes("/Vb")) {
|
|
|
+ // return "vb_components"
|
|
|
+ // }
|
|
|
if (id.includes("/src/core/utils/") && id.includes("/Vb")) {
|
|
|
return "vb_utils"
|
|
|
}
|
|
|
@@ -87,6 +87,9 @@ export default defineConfig(({ mode, command }) => {
|
|
|
return "media/asset/[name].[hash:4].[ext]"
|
|
|
}
|
|
|
}
|
|
|
+ },
|
|
|
+ commonjsOptions: {
|
|
|
+ requireReturnsDefault: "namespace"
|
|
|
}
|
|
|
},
|
|
|
resolve: {
|
|
|
@@ -117,15 +120,17 @@ export default defineConfig(({ mode, command }) => {
|
|
|
open: true,
|
|
|
proxy: {
|
|
|
"/dev-api": {
|
|
|
- target: "http://127.0.0.1:5051",
|
|
|
+ //target: "http://127.0.0.1:5051",
|
|
|
+ target: "http://xyhapi.yue.shvber.com:4031",
|
|
|
changeOrigin: true,
|
|
|
rewrite: (p) => p.replace(/^\/dev-api/, "")
|
|
|
- },
|
|
|
- "/oss/preview": {
|
|
|
- target: "http://127.0.0.1:5051",
|
|
|
- changeOrigin: true,
|
|
|
- rewrite: (p) => p.replace(/^\/oss\/preview/, "/oss/preview")
|
|
|
}
|
|
|
+ // "/oss/preview": {
|
|
|
+ // target: "http://127.0.0.1:5051",
|
|
|
+ // changeOrigin: true,
|
|
|
+ // rewrite: (p) => p.replace(/^\/oss\/preview/, "/oss/preview")
|
|
|
+ // },
|
|
|
+
|
|
|
// "/dev-api": {
|
|
|
// target: "http://192.168.0.82:6060",
|
|
|
// changeOrigin: true,
|