ebuilds-shared 0.2.7 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-WGOU4SV3.js → chunk-CJEP5MIF.js} +8 -5
- package/dist/{chunk-QPQMXAXM.js → chunk-MK3PQX5C.js} +63 -42
- package/dist/{chunk-PTS5WW6S.mjs → chunk-O3ACFTLV.mjs} +8 -5
- package/dist/{chunk-HBWAUWPK.mjs → chunk-U32ANOUZ.mjs} +63 -42
- package/dist/index.js +3 -3
- package/dist/index.mjs +2 -2
- package/dist/stores/index.js +2 -2
- package/dist/stores/index.mjs +1 -1
- package/dist/utils/index.js +2 -2
- package/dist/utils/index.mjs +1 -1
- package/dist/vite-config/index.d.mts +12 -0
- package/dist/vite-config/index.d.ts +12 -0
- package/dist/vite-config/index.js +2 -2
- package/dist/vite-config/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -6500,6 +6500,7 @@ function setupPermission(router, useMenuStore2, pages = {}, useUserStore) {
|
|
|
6500
6500
|
updateDocumentTitle(commonStore.getWebsiteTitle, to);
|
|
6501
6501
|
const whiteList = commonStore.getRouteWhitelist;
|
|
6502
6502
|
const userStore = useUserStore();
|
|
6503
|
+
const menuStore = useMenuStore2();
|
|
6503
6504
|
if (window.microApp) {
|
|
6504
6505
|
const data = window.microApp.getData();
|
|
6505
6506
|
if (data.userState) {
|
|
@@ -6514,7 +6515,6 @@ function setupPermission(router, useMenuStore2, pages = {}, useUserStore) {
|
|
|
6514
6515
|
next("/");
|
|
6515
6516
|
} else {
|
|
6516
6517
|
try {
|
|
6517
|
-
const menuStore = useMenuStore2();
|
|
6518
6518
|
if (menuStore.getHasGetMenuList) {
|
|
6519
6519
|
await addVersion({ to, next, version });
|
|
6520
6520
|
} else {
|
|
@@ -6782,7 +6782,11 @@ function createFunctionalComponent(component, options) {
|
|
|
6782
6782
|
const container = document.createElement("div");
|
|
6783
6783
|
const vnode = _vue.createVNode.call(void 0, component, props, slots);
|
|
6784
6784
|
_vue.render.call(void 0, vnode, container);
|
|
6785
|
-
document.body
|
|
6785
|
+
let fehterDom = document.body;
|
|
6786
|
+
if (window.microApp && window.rawDocument) {
|
|
6787
|
+
fehterDom = window.rawDocument.body;
|
|
6788
|
+
}
|
|
6789
|
+
fehterDom.appendChild(container.firstElementChild);
|
|
6786
6790
|
const instance = _optionalChain([vnode, 'access', _12 => _12.component, 'optionalAccess', _13 => _13.exposed]) || {};
|
|
6787
6791
|
instance.destroy = (delay = 300) => {
|
|
6788
6792
|
setTimeout(() => {
|
|
@@ -6844,14 +6848,13 @@ var useMenuStore = _pinia.defineStore.call(void 0, "menu", {
|
|
|
6844
6848
|
routeData = data.menuData || [];
|
|
6845
6849
|
if (_optionalChain([data, 'optionalAccess', _14 => _14.defaultPath])) {
|
|
6846
6850
|
defaultPath = data.defaultPath || "";
|
|
6847
|
-
}
|
|
6848
|
-
if (_optionalChain([data, 'optionalAccess', _15 => _15.subAppRoute])) {
|
|
6851
|
+
} else if (_optionalChain([data, 'optionalAccess', _15 => _15.subAppRoute])) {
|
|
6849
6852
|
defaultPath = data.subAppRoute.path || "";
|
|
6850
6853
|
}
|
|
6851
6854
|
}
|
|
6852
6855
|
this.menuList = routeData;
|
|
6853
6856
|
const validRoutes = handleRoutes(routeData, pages);
|
|
6854
|
-
console.log("\u8DEF\u7531:", validRoutes);
|
|
6857
|
+
console.log("\u8DEF\u7531:", validRoutes, defaultPath);
|
|
6855
6858
|
validRoutes.forEach((route) => {
|
|
6856
6859
|
try {
|
|
6857
6860
|
router.addRoute(route);
|
|
@@ -288,12 +288,12 @@ var hash = (
|
|
|
288
288
|
function getHash(text) {
|
|
289
289
|
return hash("sha256", text, "hex").substring(0, 8);
|
|
290
290
|
}
|
|
291
|
-
function slash(
|
|
292
|
-
const isExtendedLengthPath =
|
|
291
|
+
function slash(path3) {
|
|
292
|
+
const isExtendedLengthPath = path3.startsWith("\\\\?\\");
|
|
293
293
|
if (isExtendedLengthPath) {
|
|
294
|
-
return
|
|
294
|
+
return path3;
|
|
295
295
|
}
|
|
296
|
-
return
|
|
296
|
+
return path3.replace(/\\/g, "/");
|
|
297
297
|
}
|
|
298
298
|
function createRollupError(id, error) {
|
|
299
299
|
const { message, name, stack } = error;
|
|
@@ -730,16 +730,16 @@ function parseAbsoluteUrl(input) {
|
|
|
730
730
|
}
|
|
731
731
|
function parseFileUrl(input) {
|
|
732
732
|
const match = fileRegex.exec(input);
|
|
733
|
-
const
|
|
734
|
-
return makeUrl("file:", "", match[1] || "", "", isAbsolutePath(
|
|
733
|
+
const path3 = match[2];
|
|
734
|
+
return makeUrl("file:", "", match[1] || "", "", isAbsolutePath(path3) ? path3 : "/" + path3, match[3] || "", match[4] || "");
|
|
735
735
|
}
|
|
736
|
-
function makeUrl(scheme, user, host, port,
|
|
736
|
+
function makeUrl(scheme, user, host, port, path3, query, hash2) {
|
|
737
737
|
return {
|
|
738
738
|
scheme,
|
|
739
739
|
user,
|
|
740
740
|
host,
|
|
741
741
|
port,
|
|
742
|
-
path:
|
|
742
|
+
path: path3,
|
|
743
743
|
query,
|
|
744
744
|
hash: hash2,
|
|
745
745
|
type: 7
|
|
@@ -769,11 +769,11 @@ function parseUrl(input) {
|
|
|
769
769
|
url.type = input ? input.startsWith("?") ? 3 : input.startsWith("#") ? 2 : 4 : 1;
|
|
770
770
|
return url;
|
|
771
771
|
}
|
|
772
|
-
function stripPathFilename(
|
|
773
|
-
if (
|
|
774
|
-
return
|
|
775
|
-
const index =
|
|
776
|
-
return
|
|
772
|
+
function stripPathFilename(path3) {
|
|
773
|
+
if (path3.endsWith("/.."))
|
|
774
|
+
return path3;
|
|
775
|
+
const index = path3.lastIndexOf("/");
|
|
776
|
+
return path3.slice(0, index + 1);
|
|
777
777
|
}
|
|
778
778
|
function mergePaths(url, base) {
|
|
779
779
|
normalizePath(base, base.type);
|
|
@@ -811,14 +811,14 @@ function normalizePath(url, type) {
|
|
|
811
811
|
pieces[pointer++] = piece;
|
|
812
812
|
positive++;
|
|
813
813
|
}
|
|
814
|
-
let
|
|
814
|
+
let path3 = "";
|
|
815
815
|
for (let i = 1; i < pointer; i++) {
|
|
816
|
-
|
|
816
|
+
path3 += "/" + pieces[i];
|
|
817
817
|
}
|
|
818
|
-
if (!
|
|
819
|
-
|
|
818
|
+
if (!path3 || addTrailingSlash && !path3.endsWith("/..")) {
|
|
819
|
+
path3 += "/";
|
|
820
820
|
}
|
|
821
|
-
url.path =
|
|
821
|
+
url.path = path3;
|
|
822
822
|
}
|
|
823
823
|
function resolve$1(input, base) {
|
|
824
824
|
if (!input && !base)
|
|
@@ -859,13 +859,13 @@ function resolve$1(input, base) {
|
|
|
859
859
|
case 3:
|
|
860
860
|
return queryHash;
|
|
861
861
|
case 4: {
|
|
862
|
-
const
|
|
863
|
-
if (!
|
|
862
|
+
const path3 = url.path.slice(1);
|
|
863
|
+
if (!path3)
|
|
864
864
|
return queryHash || ".";
|
|
865
|
-
if (isRelative(base || input) && !isRelative(
|
|
866
|
-
return "./" +
|
|
865
|
+
if (isRelative(base || input) && !isRelative(path3)) {
|
|
866
|
+
return "./" + path3 + queryHash;
|
|
867
867
|
}
|
|
868
|
-
return
|
|
868
|
+
return path3 + queryHash;
|
|
869
869
|
}
|
|
870
870
|
case 5:
|
|
871
871
|
return url.path + queryHash;
|
|
@@ -878,11 +878,11 @@ function resolve(input, base) {
|
|
|
878
878
|
base += "/";
|
|
879
879
|
return resolve$1(input, base);
|
|
880
880
|
}
|
|
881
|
-
function stripFilename(
|
|
882
|
-
if (!
|
|
881
|
+
function stripFilename(path3) {
|
|
882
|
+
if (!path3)
|
|
883
883
|
return "";
|
|
884
|
-
const index =
|
|
885
|
-
return
|
|
884
|
+
const index = path3.lastIndexOf("/");
|
|
885
|
+
return path3.slice(0, index + 1);
|
|
886
886
|
}
|
|
887
887
|
var COLUMN$1 = 0;
|
|
888
888
|
function maybeSort(mappings, owned) {
|
|
@@ -2733,14 +2733,39 @@ var AutoImportDeps = (isDev) => {
|
|
|
2733
2733
|
name: "dev-auto-import-antdv",
|
|
2734
2734
|
transform(code, id) {
|
|
2735
2735
|
if (/src\/main\.ts$/.test(id)) {
|
|
2736
|
+
const dayjsConfig = `
|
|
2737
|
+
// \u914D\u7F6E dayjs \u4E2D\u6587 locale\uFF08\u5FC5\u987B\u5728 Element Plus \u6CE8\u518C\u4E4B\u524D\uFF09
|
|
2738
|
+
import dayjs from 'dayjs';
|
|
2739
|
+
import 'dayjs/locale/zh-cn';
|
|
2740
|
+
dayjs.locale('zh-cn');
|
|
2741
|
+
`;
|
|
2742
|
+
const createAppIndex = code.indexOf("createApp");
|
|
2743
|
+
if (createAppIndex !== -1) {
|
|
2744
|
+
const lastImportMatch = code.match(/import[\s\S]*?from[\s\S]*?;[\s\n]*$/m);
|
|
2745
|
+
const insertIndex = lastImportMatch ? lastImportMatch.index + lastImportMatch[0].length : createAppIndex;
|
|
2746
|
+
return {
|
|
2747
|
+
code: code.slice(0, insertIndex) + dayjsConfig + code.slice(insertIndex) + `
|
|
2748
|
+
// \u6CE8\u518C Element Plus \u548C Ant Design Vue
|
|
2749
|
+
import ElementPlus from 'element-plus';
|
|
2750
|
+
import 'element-plus/dist/index.css';
|
|
2751
|
+
import zhCn from 'element-plus/es/locale/lang/zh-cn';
|
|
2752
|
+
import Antd from 'ant-design-vue';
|
|
2753
|
+
import 'ant-design-vue/dist/reset.css';
|
|
2754
|
+
app.use(ElementPlus, { locale: zhCn });
|
|
2755
|
+
app.use(Antd);
|
|
2756
|
+
`,
|
|
2757
|
+
map: null
|
|
2758
|
+
};
|
|
2759
|
+
}
|
|
2736
2760
|
return {
|
|
2737
|
-
code: code + `
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2761
|
+
code: dayjsConfig + code + `
|
|
2762
|
+
import ElementPlus from 'element-plus';
|
|
2763
|
+
import 'element-plus/dist/index.css';
|
|
2764
|
+
import zhCn from 'element-plus/es/locale/lang/zh-cn';
|
|
2765
|
+
import Antd from 'ant-design-vue';
|
|
2766
|
+
import 'ant-design-vue/dist/reset.css';
|
|
2767
|
+
app.use(ElementPlus, { locale: zhCn });
|
|
2768
|
+
app.use(Antd);
|
|
2744
2769
|
`,
|
|
2745
2770
|
map: null
|
|
2746
2771
|
};
|
|
@@ -2799,7 +2824,7 @@ function convertProxyConfig(data, replaceFunction) {
|
|
|
2799
2824
|
// 启用origin头修改
|
|
2800
2825
|
secure: false,
|
|
2801
2826
|
// 路径重写:移除请求路径中的统一前缀(如/api)
|
|
2802
|
-
rewrite: replaceFunction || ((
|
|
2827
|
+
rewrite: replaceFunction || ((path3) => path3.replace(new RegExp(`${dev_prefix}`), ""))
|
|
2803
2828
|
};
|
|
2804
2829
|
}
|
|
2805
2830
|
return result;
|
|
@@ -2822,10 +2847,6 @@ function server_default(devPort = 5e3, proxyConfig, baseUrl = "/") {
|
|
|
2822
2847
|
}
|
|
2823
2848
|
|
|
2824
2849
|
// src/vite-config/build/index.ts
|
|
2825
|
-
|
|
2826
|
-
var _url = require('url');
|
|
2827
|
-
var __filename = _url.fileURLToPath.call(void 0, import.meta.url);
|
|
2828
|
-
var __dirname = _path2.default.dirname(__filename);
|
|
2829
2850
|
var config = (isProduction) => {
|
|
2830
2851
|
return {
|
|
2831
2852
|
/**
|
|
@@ -2909,7 +2930,7 @@ function createBaseViteConfig(options) {
|
|
|
2909
2930
|
const env = _vite.loadEnv.call(void 0, config2.mode, process.cwd(), "VITE_");
|
|
2910
2931
|
const isDev = config2.mode === "development";
|
|
2911
2932
|
const isProd = config2.mode === "production";
|
|
2912
|
-
const { port = 5e3, plugins = [], proxy, showDevTools = false, enableOptimizeDeps = true, baseUrl } = options;
|
|
2933
|
+
const { port = 5e3, plugins = [], proxy, showDevTools = false, enableOptimizeDeps = true, baseUrl, customConfig = {} } = options;
|
|
2913
2934
|
const buildConfig = build_default(isProd);
|
|
2914
2935
|
return {
|
|
2915
2936
|
plugins: createVitePlugins(plugins, showDevTools, isDev),
|
|
@@ -2924,10 +2945,10 @@ function createBaseViteConfig(options) {
|
|
|
2924
2945
|
pure: ["console.log"]
|
|
2925
2946
|
// 仅标记纯函数,配合 drop 使用
|
|
2926
2947
|
} : void 0,
|
|
2927
|
-
treeshake: isProd ? { preset: "recommended" } : true,
|
|
2928
2948
|
optimizeDeps: {
|
|
2929
2949
|
include: enableOptimizeDeps ? ["vue", "vue-router", "pinia", "axios", "element-plus", "ant-design-vue", "echarts"] : []
|
|
2930
|
-
}
|
|
2950
|
+
},
|
|
2951
|
+
...customConfig
|
|
2931
2952
|
};
|
|
2932
2953
|
});
|
|
2933
2954
|
}
|
|
@@ -6500,6 +6500,7 @@ function setupPermission(router, useMenuStore2, pages = {}, useUserStore) {
|
|
|
6500
6500
|
updateDocumentTitle(commonStore.getWebsiteTitle, to);
|
|
6501
6501
|
const whiteList = commonStore.getRouteWhitelist;
|
|
6502
6502
|
const userStore = useUserStore();
|
|
6503
|
+
const menuStore = useMenuStore2();
|
|
6503
6504
|
if (window.microApp) {
|
|
6504
6505
|
const data = window.microApp.getData();
|
|
6505
6506
|
if (data.userState) {
|
|
@@ -6514,7 +6515,6 @@ function setupPermission(router, useMenuStore2, pages = {}, useUserStore) {
|
|
|
6514
6515
|
next("/");
|
|
6515
6516
|
} else {
|
|
6516
6517
|
try {
|
|
6517
|
-
const menuStore = useMenuStore2();
|
|
6518
6518
|
if (menuStore.getHasGetMenuList) {
|
|
6519
6519
|
await addVersion({ to, next, version });
|
|
6520
6520
|
} else {
|
|
@@ -6782,7 +6782,11 @@ function createFunctionalComponent(component, options) {
|
|
|
6782
6782
|
const container = document.createElement("div");
|
|
6783
6783
|
const vnode = createVNode(component, props, slots);
|
|
6784
6784
|
render(vnode, container);
|
|
6785
|
-
document.body
|
|
6785
|
+
let fehterDom = document.body;
|
|
6786
|
+
if (window.microApp && window.rawDocument) {
|
|
6787
|
+
fehterDom = window.rawDocument.body;
|
|
6788
|
+
}
|
|
6789
|
+
fehterDom.appendChild(container.firstElementChild);
|
|
6786
6790
|
const instance = vnode.component?.exposed || {};
|
|
6787
6791
|
instance.destroy = (delay = 300) => {
|
|
6788
6792
|
setTimeout(() => {
|
|
@@ -6844,14 +6848,13 @@ var useMenuStore = defineStore3("menu", {
|
|
|
6844
6848
|
routeData = data.menuData || [];
|
|
6845
6849
|
if (data?.defaultPath) {
|
|
6846
6850
|
defaultPath = data.defaultPath || "";
|
|
6847
|
-
}
|
|
6848
|
-
if (data?.subAppRoute) {
|
|
6851
|
+
} else if (data?.subAppRoute) {
|
|
6849
6852
|
defaultPath = data.subAppRoute.path || "";
|
|
6850
6853
|
}
|
|
6851
6854
|
}
|
|
6852
6855
|
this.menuList = routeData;
|
|
6853
6856
|
const validRoutes = handleRoutes(routeData, pages);
|
|
6854
|
-
console.log("\u8DEF\u7531:", validRoutes);
|
|
6857
|
+
console.log("\u8DEF\u7531:", validRoutes, defaultPath);
|
|
6855
6858
|
validRoutes.forEach((route) => {
|
|
6856
6859
|
try {
|
|
6857
6860
|
router.addRoute(route);
|
|
@@ -288,12 +288,12 @@ var hash = (
|
|
|
288
288
|
function getHash(text) {
|
|
289
289
|
return hash("sha256", text, "hex").substring(0, 8);
|
|
290
290
|
}
|
|
291
|
-
function slash(
|
|
292
|
-
const isExtendedLengthPath =
|
|
291
|
+
function slash(path3) {
|
|
292
|
+
const isExtendedLengthPath = path3.startsWith("\\\\?\\");
|
|
293
293
|
if (isExtendedLengthPath) {
|
|
294
|
-
return
|
|
294
|
+
return path3;
|
|
295
295
|
}
|
|
296
|
-
return
|
|
296
|
+
return path3.replace(/\\/g, "/");
|
|
297
297
|
}
|
|
298
298
|
function createRollupError(id, error) {
|
|
299
299
|
const { message, name, stack } = error;
|
|
@@ -730,16 +730,16 @@ function parseAbsoluteUrl(input) {
|
|
|
730
730
|
}
|
|
731
731
|
function parseFileUrl(input) {
|
|
732
732
|
const match = fileRegex.exec(input);
|
|
733
|
-
const
|
|
734
|
-
return makeUrl("file:", "", match[1] || "", "", isAbsolutePath(
|
|
733
|
+
const path3 = match[2];
|
|
734
|
+
return makeUrl("file:", "", match[1] || "", "", isAbsolutePath(path3) ? path3 : "/" + path3, match[3] || "", match[4] || "");
|
|
735
735
|
}
|
|
736
|
-
function makeUrl(scheme, user, host, port,
|
|
736
|
+
function makeUrl(scheme, user, host, port, path3, query, hash2) {
|
|
737
737
|
return {
|
|
738
738
|
scheme,
|
|
739
739
|
user,
|
|
740
740
|
host,
|
|
741
741
|
port,
|
|
742
|
-
path:
|
|
742
|
+
path: path3,
|
|
743
743
|
query,
|
|
744
744
|
hash: hash2,
|
|
745
745
|
type: 7
|
|
@@ -769,11 +769,11 @@ function parseUrl(input) {
|
|
|
769
769
|
url.type = input ? input.startsWith("?") ? 3 : input.startsWith("#") ? 2 : 4 : 1;
|
|
770
770
|
return url;
|
|
771
771
|
}
|
|
772
|
-
function stripPathFilename(
|
|
773
|
-
if (
|
|
774
|
-
return
|
|
775
|
-
const index =
|
|
776
|
-
return
|
|
772
|
+
function stripPathFilename(path3) {
|
|
773
|
+
if (path3.endsWith("/.."))
|
|
774
|
+
return path3;
|
|
775
|
+
const index = path3.lastIndexOf("/");
|
|
776
|
+
return path3.slice(0, index + 1);
|
|
777
777
|
}
|
|
778
778
|
function mergePaths(url, base) {
|
|
779
779
|
normalizePath(base, base.type);
|
|
@@ -811,14 +811,14 @@ function normalizePath(url, type) {
|
|
|
811
811
|
pieces[pointer++] = piece;
|
|
812
812
|
positive++;
|
|
813
813
|
}
|
|
814
|
-
let
|
|
814
|
+
let path3 = "";
|
|
815
815
|
for (let i = 1; i < pointer; i++) {
|
|
816
|
-
|
|
816
|
+
path3 += "/" + pieces[i];
|
|
817
817
|
}
|
|
818
|
-
if (!
|
|
819
|
-
|
|
818
|
+
if (!path3 || addTrailingSlash && !path3.endsWith("/..")) {
|
|
819
|
+
path3 += "/";
|
|
820
820
|
}
|
|
821
|
-
url.path =
|
|
821
|
+
url.path = path3;
|
|
822
822
|
}
|
|
823
823
|
function resolve$1(input, base) {
|
|
824
824
|
if (!input && !base)
|
|
@@ -859,13 +859,13 @@ function resolve$1(input, base) {
|
|
|
859
859
|
case 3:
|
|
860
860
|
return queryHash;
|
|
861
861
|
case 4: {
|
|
862
|
-
const
|
|
863
|
-
if (!
|
|
862
|
+
const path3 = url.path.slice(1);
|
|
863
|
+
if (!path3)
|
|
864
864
|
return queryHash || ".";
|
|
865
|
-
if (isRelative(base || input) && !isRelative(
|
|
866
|
-
return "./" +
|
|
865
|
+
if (isRelative(base || input) && !isRelative(path3)) {
|
|
866
|
+
return "./" + path3 + queryHash;
|
|
867
867
|
}
|
|
868
|
-
return
|
|
868
|
+
return path3 + queryHash;
|
|
869
869
|
}
|
|
870
870
|
case 5:
|
|
871
871
|
return url.path + queryHash;
|
|
@@ -878,11 +878,11 @@ function resolve(input, base) {
|
|
|
878
878
|
base += "/";
|
|
879
879
|
return resolve$1(input, base);
|
|
880
880
|
}
|
|
881
|
-
function stripFilename(
|
|
882
|
-
if (!
|
|
881
|
+
function stripFilename(path3) {
|
|
882
|
+
if (!path3)
|
|
883
883
|
return "";
|
|
884
|
-
const index =
|
|
885
|
-
return
|
|
884
|
+
const index = path3.lastIndexOf("/");
|
|
885
|
+
return path3.slice(0, index + 1);
|
|
886
886
|
}
|
|
887
887
|
var COLUMN$1 = 0;
|
|
888
888
|
function maybeSort(mappings, owned) {
|
|
@@ -2733,14 +2733,39 @@ var AutoImportDeps = (isDev) => {
|
|
|
2733
2733
|
name: "dev-auto-import-antdv",
|
|
2734
2734
|
transform(code, id) {
|
|
2735
2735
|
if (/src\/main\.ts$/.test(id)) {
|
|
2736
|
+
const dayjsConfig = `
|
|
2737
|
+
// \u914D\u7F6E dayjs \u4E2D\u6587 locale\uFF08\u5FC5\u987B\u5728 Element Plus \u6CE8\u518C\u4E4B\u524D\uFF09
|
|
2738
|
+
import dayjs from 'dayjs';
|
|
2739
|
+
import 'dayjs/locale/zh-cn';
|
|
2740
|
+
dayjs.locale('zh-cn');
|
|
2741
|
+
`;
|
|
2742
|
+
const createAppIndex = code.indexOf("createApp");
|
|
2743
|
+
if (createAppIndex !== -1) {
|
|
2744
|
+
const lastImportMatch = code.match(/import[\s\S]*?from[\s\S]*?;[\s\n]*$/m);
|
|
2745
|
+
const insertIndex = lastImportMatch ? lastImportMatch.index + lastImportMatch[0].length : createAppIndex;
|
|
2746
|
+
return {
|
|
2747
|
+
code: code.slice(0, insertIndex) + dayjsConfig + code.slice(insertIndex) + `
|
|
2748
|
+
// \u6CE8\u518C Element Plus \u548C Ant Design Vue
|
|
2749
|
+
import ElementPlus from 'element-plus';
|
|
2750
|
+
import 'element-plus/dist/index.css';
|
|
2751
|
+
import zhCn from 'element-plus/es/locale/lang/zh-cn';
|
|
2752
|
+
import Antd from 'ant-design-vue';
|
|
2753
|
+
import 'ant-design-vue/dist/reset.css';
|
|
2754
|
+
app.use(ElementPlus, { locale: zhCn });
|
|
2755
|
+
app.use(Antd);
|
|
2756
|
+
`,
|
|
2757
|
+
map: null
|
|
2758
|
+
};
|
|
2759
|
+
}
|
|
2736
2760
|
return {
|
|
2737
|
-
code: code + `
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2761
|
+
code: dayjsConfig + code + `
|
|
2762
|
+
import ElementPlus from 'element-plus';
|
|
2763
|
+
import 'element-plus/dist/index.css';
|
|
2764
|
+
import zhCn from 'element-plus/es/locale/lang/zh-cn';
|
|
2765
|
+
import Antd from 'ant-design-vue';
|
|
2766
|
+
import 'ant-design-vue/dist/reset.css';
|
|
2767
|
+
app.use(ElementPlus, { locale: zhCn });
|
|
2768
|
+
app.use(Antd);
|
|
2744
2769
|
`,
|
|
2745
2770
|
map: null
|
|
2746
2771
|
};
|
|
@@ -2799,7 +2824,7 @@ function convertProxyConfig(data, replaceFunction) {
|
|
|
2799
2824
|
// 启用origin头修改
|
|
2800
2825
|
secure: false,
|
|
2801
2826
|
// 路径重写:移除请求路径中的统一前缀(如/api)
|
|
2802
|
-
rewrite: replaceFunction || ((
|
|
2827
|
+
rewrite: replaceFunction || ((path3) => path3.replace(new RegExp(`${dev_prefix}`), ""))
|
|
2803
2828
|
};
|
|
2804
2829
|
}
|
|
2805
2830
|
return result;
|
|
@@ -2822,10 +2847,6 @@ function server_default(devPort = 5e3, proxyConfig, baseUrl = "/") {
|
|
|
2822
2847
|
}
|
|
2823
2848
|
|
|
2824
2849
|
// src/vite-config/build/index.ts
|
|
2825
|
-
import path3 from "path";
|
|
2826
|
-
import { fileURLToPath } from "url";
|
|
2827
|
-
var __filename = fileURLToPath(import.meta.url);
|
|
2828
|
-
var __dirname = path3.dirname(__filename);
|
|
2829
2850
|
var config = (isProduction) => {
|
|
2830
2851
|
return {
|
|
2831
2852
|
/**
|
|
@@ -2909,7 +2930,7 @@ function createBaseViteConfig(options) {
|
|
|
2909
2930
|
const env = loadEnv(config2.mode, process.cwd(), "VITE_");
|
|
2910
2931
|
const isDev = config2.mode === "development";
|
|
2911
2932
|
const isProd = config2.mode === "production";
|
|
2912
|
-
const { port = 5e3, plugins = [], proxy, showDevTools = false, enableOptimizeDeps = true, baseUrl } = options;
|
|
2933
|
+
const { port = 5e3, plugins = [], proxy, showDevTools = false, enableOptimizeDeps = true, baseUrl, customConfig = {} } = options;
|
|
2913
2934
|
const buildConfig = build_default(isProd);
|
|
2914
2935
|
return {
|
|
2915
2936
|
plugins: createVitePlugins(plugins, showDevTools, isDev),
|
|
@@ -2924,10 +2945,10 @@ function createBaseViteConfig(options) {
|
|
|
2924
2945
|
pure: ["console.log"]
|
|
2925
2946
|
// 仅标记纯函数,配合 drop 使用
|
|
2926
2947
|
} : void 0,
|
|
2927
|
-
treeshake: isProd ? { preset: "recommended" } : true,
|
|
2928
2948
|
optimizeDeps: {
|
|
2929
2949
|
include: enableOptimizeDeps ? ["vue", "vue-router", "pinia", "axios", "element-plus", "ant-design-vue", "echarts"] : []
|
|
2930
|
-
}
|
|
2950
|
+
},
|
|
2951
|
+
...customConfig
|
|
2931
2952
|
};
|
|
2932
2953
|
});
|
|
2933
2954
|
}
|
package/dist/index.js
CHANGED
|
@@ -29,10 +29,10 @@ var _chunk3YUIFF3Jjs = require('./chunk-3YUIFF3J.js');
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _chunkCJEP5MIFjs = require('./chunk-CJEP5MIF.js');
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
var
|
|
35
|
+
var _chunkMK3PQX5Cjs = require('./chunk-MK3PQX5C.js');
|
|
36
36
|
require('./chunk-QGM4M3NI.js');
|
|
37
37
|
|
|
38
38
|
|
|
@@ -64,4 +64,4 @@ require('./chunk-QGM4M3NI.js');
|
|
|
64
64
|
|
|
65
65
|
|
|
66
66
|
|
|
67
|
-
exports.clamp =
|
|
67
|
+
exports.clamp = _chunkCJEP5MIFjs.clamp; exports.createBaseViteConfig = _chunkMK3PQX5Cjs.createBaseViteConfig; exports.createFunctionalComponent = _chunkCJEP5MIFjs.createFunctionalComponent; exports.createUnoConfig = _chunk3YUIFF3Jjs.createUnoConfig; exports.duplicateRemovalCompleteSort = _chunkCJEP5MIFjs.duplicateRemovalCompleteSort; exports.encryptPwd = _chunkCJEP5MIFjs.encryptPwd; exports.filterMenu = _chunkCJEP5MIFjs.filterMenu; exports.formatNumber = _chunkCJEP5MIFjs.formatNumber; exports.getDecimalPart = _chunkCJEP5MIFjs.getDecimalPart; exports.getIntegerPart = _chunkCJEP5MIFjs.getIntegerPart; exports.isInteger = _chunkCJEP5MIFjs.isInteger; exports.isNumber = _chunkCJEP5MIFjs.isNumber; exports.jsonp = _chunkCJEP5MIFjs.jsonp; exports.listSort = _chunkCJEP5MIFjs.listSort; exports.numberToChinese = _chunkCJEP5MIFjs.numberToChinese; exports.padZero = _chunkCJEP5MIFjs.padZero; exports.parseFormattedNumber = _chunkCJEP5MIFjs.parseFormattedNumber; exports.prototypeInterceptor = _chunkCJEP5MIFjs.prototypeInterceptor; exports.request = _chunkCJEP5MIFjs.request; exports.roundOrTruncate = _chunkCJEP5MIFjs.roundOrTruncate; exports.setupPermission = _chunkCJEP5MIFjs.setupPermission; exports.store = _chunkCJEP5MIFjs.store; exports.timeFix = _chunkCJEP5MIFjs.timeFix; exports.updateDocumentTitle = _chunkCJEP5MIFjs.updateDocumentTitle; exports.useCommonStore = _chunkCJEP5MIFjs.useCommonStore; exports.useDbStore = _chunkCJEP5MIFjs.useDbStore; exports.useLoginHook = _chunkCJEP5MIFjs.useLoginHook; exports.useMenuStore = _chunkCJEP5MIFjs.useMenuStore; exports.welcome = _chunkCJEP5MIFjs.welcome;
|
package/dist/index.mjs
CHANGED
|
@@ -29,10 +29,10 @@ import {
|
|
|
29
29
|
useLoginHook,
|
|
30
30
|
useMenuStore,
|
|
31
31
|
welcome
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-O3ACFTLV.mjs";
|
|
33
33
|
import {
|
|
34
34
|
createBaseViteConfig
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-U32ANOUZ.mjs";
|
|
36
36
|
import "./chunk-6DZX6EAA.mjs";
|
|
37
37
|
export {
|
|
38
38
|
clamp,
|
package/dist/stores/index.js
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkCJEP5MIFjs = require('../chunk-CJEP5MIF.js');
|
|
7
7
|
require('../chunk-QGM4M3NI.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
exports.store =
|
|
13
|
+
exports.store = _chunkCJEP5MIFjs.store; exports.useCommonStore = _chunkCJEP5MIFjs.useCommonStore; exports.useDbStore = _chunkCJEP5MIFjs.useDbStore; exports.useMenuStore = _chunkCJEP5MIFjs.useMenuStore;
|
package/dist/stores/index.mjs
CHANGED
package/dist/utils/index.js
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var _chunkCJEP5MIFjs = require('../chunk-CJEP5MIF.js');
|
|
26
26
|
require('../chunk-QGM4M3NI.js');
|
|
27
27
|
|
|
28
28
|
|
|
@@ -48,4 +48,4 @@ require('../chunk-QGM4M3NI.js');
|
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
|
|
51
|
-
exports.clamp =
|
|
51
|
+
exports.clamp = _chunkCJEP5MIFjs.clamp; exports.createFunctionalComponent = _chunkCJEP5MIFjs.createFunctionalComponent; exports.duplicateRemovalCompleteSort = _chunkCJEP5MIFjs.duplicateRemovalCompleteSort; exports.encryptPwd = _chunkCJEP5MIFjs.encryptPwd; exports.filterMenu = _chunkCJEP5MIFjs.filterMenu; exports.formatNumber = _chunkCJEP5MIFjs.formatNumber; exports.getDecimalPart = _chunkCJEP5MIFjs.getDecimalPart; exports.getIntegerPart = _chunkCJEP5MIFjs.getIntegerPart; exports.isInteger = _chunkCJEP5MIFjs.isInteger; exports.isNumber = _chunkCJEP5MIFjs.isNumber; exports.jsonp = _chunkCJEP5MIFjs.jsonp; exports.listSort = _chunkCJEP5MIFjs.listSort; exports.numberToChinese = _chunkCJEP5MIFjs.numberToChinese; exports.padZero = _chunkCJEP5MIFjs.padZero; exports.parseFormattedNumber = _chunkCJEP5MIFjs.parseFormattedNumber; exports.prototypeInterceptor = _chunkCJEP5MIFjs.prototypeInterceptor; exports.request = _chunkCJEP5MIFjs.request; exports.roundOrTruncate = _chunkCJEP5MIFjs.roundOrTruncate; exports.setupPermission = _chunkCJEP5MIFjs.setupPermission; exports.timeFix = _chunkCJEP5MIFjs.timeFix; exports.updateDocumentTitle = _chunkCJEP5MIFjs.updateDocumentTitle; exports.useLoginHook = _chunkCJEP5MIFjs.useLoginHook; exports.welcome = _chunkCJEP5MIFjs.welcome;
|
package/dist/utils/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as vite from 'vite';
|
|
2
|
+
import { UserConfig } from 'vite';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* 代理配置接口 - 定义代理路径前缀与目标服务地址的映射关系
|
|
@@ -14,6 +15,16 @@ type proxyConfigType = {
|
|
|
14
15
|
replaceFunction?: (path: string) => string;
|
|
15
16
|
};
|
|
16
17
|
|
|
18
|
+
/**
|
|
19
|
+
* 配置项
|
|
20
|
+
* @param port 端口 默认 3000
|
|
21
|
+
* @param plugins 插件
|
|
22
|
+
* @param proxy 代理
|
|
23
|
+
* @param showDevTools 是否显示开发工具
|
|
24
|
+
* @param enableOptimizeDeps 是否启用预构建优化
|
|
25
|
+
* @param baseUrl 请求根地址
|
|
26
|
+
* @param customConfig 自定义配置,会覆盖默认配置,详细配置项请参考 https://vitejs.dev/config/
|
|
27
|
+
*/
|
|
17
28
|
interface Options {
|
|
18
29
|
port?: number;
|
|
19
30
|
plugins?: any[];
|
|
@@ -21,6 +32,7 @@ interface Options {
|
|
|
21
32
|
showDevTools?: boolean;
|
|
22
33
|
enableOptimizeDeps?: boolean;
|
|
23
34
|
baseUrl?: string;
|
|
35
|
+
customConfig?: UserConfig;
|
|
24
36
|
}
|
|
25
37
|
/**
|
|
26
38
|
* 创建 vite 配置
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as vite from 'vite';
|
|
2
|
+
import { UserConfig } from 'vite';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* 代理配置接口 - 定义代理路径前缀与目标服务地址的映射关系
|
|
@@ -14,6 +15,16 @@ type proxyConfigType = {
|
|
|
14
15
|
replaceFunction?: (path: string) => string;
|
|
15
16
|
};
|
|
16
17
|
|
|
18
|
+
/**
|
|
19
|
+
* 配置项
|
|
20
|
+
* @param port 端口 默认 3000
|
|
21
|
+
* @param plugins 插件
|
|
22
|
+
* @param proxy 代理
|
|
23
|
+
* @param showDevTools 是否显示开发工具
|
|
24
|
+
* @param enableOptimizeDeps 是否启用预构建优化
|
|
25
|
+
* @param baseUrl 请求根地址
|
|
26
|
+
* @param customConfig 自定义配置,会覆盖默认配置,详细配置项请参考 https://vitejs.dev/config/
|
|
27
|
+
*/
|
|
17
28
|
interface Options {
|
|
18
29
|
port?: number;
|
|
19
30
|
plugins?: any[];
|
|
@@ -21,6 +32,7 @@ interface Options {
|
|
|
21
32
|
showDevTools?: boolean;
|
|
22
33
|
enableOptimizeDeps?: boolean;
|
|
23
34
|
baseUrl?: string;
|
|
35
|
+
customConfig?: UserConfig;
|
|
24
36
|
}
|
|
25
37
|
/**
|
|
26
38
|
* 创建 vite 配置
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkMK3PQX5Cjs = require('../chunk-MK3PQX5C.js');
|
|
4
4
|
require('../chunk-QGM4M3NI.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
exports.createBaseViteConfig =
|
|
7
|
+
exports.createBaseViteConfig = _chunkMK3PQX5Cjs.createBaseViteConfig;
|