ebuilds-shared 0.2.8 → 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-YXHM6TUN.js → chunk-CJEP5MIF.js} +5 -1
- package/dist/{chunk-F2CZ3CMW.js → chunk-MK3PQX5C.js} +35 -10
- package/dist/{chunk-IFPKQ66A.mjs → chunk-O3ACFTLV.mjs} +5 -1
- package/dist/{chunk-BQBUWOOS.mjs → chunk-U32ANOUZ.mjs} +35 -10
- 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
|
@@ -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(() => {
|
|
@@ -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
|
};
|
|
@@ -2905,7 +2930,7 @@ function createBaseViteConfig(options) {
|
|
|
2905
2930
|
const env = _vite.loadEnv.call(void 0, config2.mode, process.cwd(), "VITE_");
|
|
2906
2931
|
const isDev = config2.mode === "development";
|
|
2907
2932
|
const isProd = config2.mode === "production";
|
|
2908
|
-
const { port = 5e3, plugins = [], proxy, showDevTools = false, enableOptimizeDeps = true, baseUrl } = options;
|
|
2933
|
+
const { port = 5e3, plugins = [], proxy, showDevTools = false, enableOptimizeDeps = true, baseUrl, customConfig = {} } = options;
|
|
2909
2934
|
const buildConfig = build_default(isProd);
|
|
2910
2935
|
return {
|
|
2911
2936
|
plugins: createVitePlugins(plugins, showDevTools, isDev),
|
|
@@ -2920,10 +2945,10 @@ function createBaseViteConfig(options) {
|
|
|
2920
2945
|
pure: ["console.log"]
|
|
2921
2946
|
// 仅标记纯函数,配合 drop 使用
|
|
2922
2947
|
} : void 0,
|
|
2923
|
-
treeshake: isProd ? { preset: "recommended" } : true,
|
|
2924
2948
|
optimizeDeps: {
|
|
2925
2949
|
include: enableOptimizeDeps ? ["vue", "vue-router", "pinia", "axios", "element-plus", "ant-design-vue", "echarts"] : []
|
|
2926
|
-
}
|
|
2950
|
+
},
|
|
2951
|
+
...customConfig
|
|
2927
2952
|
};
|
|
2928
2953
|
});
|
|
2929
2954
|
}
|
|
@@ -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(() => {
|
|
@@ -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
|
};
|
|
@@ -2905,7 +2930,7 @@ function createBaseViteConfig(options) {
|
|
|
2905
2930
|
const env = loadEnv(config2.mode, process.cwd(), "VITE_");
|
|
2906
2931
|
const isDev = config2.mode === "development";
|
|
2907
2932
|
const isProd = config2.mode === "production";
|
|
2908
|
-
const { port = 5e3, plugins = [], proxy, showDevTools = false, enableOptimizeDeps = true, baseUrl } = options;
|
|
2933
|
+
const { port = 5e3, plugins = [], proxy, showDevTools = false, enableOptimizeDeps = true, baseUrl, customConfig = {} } = options;
|
|
2909
2934
|
const buildConfig = build_default(isProd);
|
|
2910
2935
|
return {
|
|
2911
2936
|
plugins: createVitePlugins(plugins, showDevTools, isDev),
|
|
@@ -2920,10 +2945,10 @@ function createBaseViteConfig(options) {
|
|
|
2920
2945
|
pure: ["console.log"]
|
|
2921
2946
|
// 仅标记纯函数,配合 drop 使用
|
|
2922
2947
|
} : void 0,
|
|
2923
|
-
treeshake: isProd ? { preset: "recommended" } : true,
|
|
2924
2948
|
optimizeDeps: {
|
|
2925
2949
|
include: enableOptimizeDeps ? ["vue", "vue-router", "pinia", "axios", "element-plus", "ant-design-vue", "echarts"] : []
|
|
2926
|
-
}
|
|
2950
|
+
},
|
|
2951
|
+
...customConfig
|
|
2927
2952
|
};
|
|
2928
2953
|
});
|
|
2929
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;
|