@bdsoft/element 1.1.18 → 1.1.20

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/index.js CHANGED
@@ -19,7 +19,7 @@ window.ElementPlusIconVue = ElementPlusIconsVue
19
19
  import LoadComponent from './src/utils/coms/load.jsx'
20
20
  // 自定义的所有组件
21
21
  import * as components from './src/index.js'
22
- debugger
22
+
23
23
  // 定义 useElement 为 Vue 插件
24
24
  const useElement = {
25
25
  install(app, options = {}) {
@@ -30,7 +30,7 @@ const useElement = {
30
30
  }
31
31
 
32
32
  // 安装 ElementPlus
33
- app.use(ElementPlus, {
33
+ app.use(options.ElementPlus, {
34
34
  locale: zhCn,
35
35
  zIndex: 3000
36
36
  })
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bdsoft/element",
3
3
  "description": "内部UI组件",
4
- "version": "1.1.18",
4
+ "version": "1.1.20",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
7
  "peerDependencies": {
package/vite.config.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { defineConfig } from "vite";
2
- import { fileURLToPath } from "node:url";
3
- // import { resolve } from 'path'
2
+ import { fileURLToPath } from 'node:url'
3
+ import { resolve } from "path";
4
4
  import vueJsx from "@vitejs/plugin-vue-jsx";
5
5
  import vue from "@vitejs/plugin-vue";
6
6
  import importToConst from "rollup-plugin-import-to-const";
@@ -11,8 +11,6 @@ export default defineConfig({
11
11
  resolve: {
12
12
  alias: {
13
13
  "@": fileURLToPath(new URL("./src", import.meta.url)),
14
- "@utils": fileURLToPath(new URL("./src/utils", import.meta.url)),
15
- global: fileURLToPath(new URL("./src/global", import.meta.url)),
16
14
  "~": fileURLToPath(new URL("./src/assets", import.meta.url)),
17
15
  },
18
16
  },
@@ -21,20 +19,13 @@ export default defineConfig({
21
19
  entry: "./index.js",
22
20
  name: "@bdsoft/element",
23
21
  fileName: "BdElement", // 输出的包文件名
24
- formats: ["esm"], // 这是默认值 'umd','cjs',
22
+ formats: ['es', 'umd','cjs'] // 这是默认值
25
23
  },
26
- // outDir: 'esaaa', // 根输出目录
24
+ outDir: "esaaa", // 根输出目录
27
25
  minify: false,
28
26
  rollupOptions: {
29
27
  //忽略打包vue文件
30
- external: [
31
- "vue",
32
- "element-plus",
33
- "dayjs",
34
- "@element-plus/icons-vue",
35
- "vue/server-renderer",
36
- "@vue/server-renderer",
37
- ], // 这里列出你想排除的外部依赖
28
+ external: ["vue", "element-plus", "@element-plus/icons-vue", "vue/server-renderer", "@vue/server-renderer"], // 这里列出你想排除的外部依赖
38
29
  output: [
39
30
  {
40
31
  //配置打包根目录
@@ -43,33 +34,17 @@ export default defineConfig({
43
34
  vue: "Vue",
44
35
  "element-plus": "ElementPlus",
45
36
  "@element-plus/icons-vue": "ElementPlusIconVue",
46
- dayjs: "dayjs",
47
37
  },
48
- esModule: true, // 强制 ES 模块输出格式的兼容性
49
- format: "es", // 组件库输出 ESM 格式,适配现代项目
50
38
  },
51
39
  ],
52
40
  },
53
- // 3. 修复 CommonJS 模块解析(针对 dayjs)
54
- commonjsOptions: {
55
- transformMixedEsModules: true, // 自动转换混合模块
56
- include: [/node_modules\/dayjs/, /node_modules\/element-plus/],
57
- },
58
- // 优化依赖:提前预构建 dayjs,避免打包时解析错误
59
- optimizeDeps: {
60
- include: ["element-plus"],
61
- esbuildOptions: {
62
- define: { global: "globalThis" },
63
- format: "esm", // 强制 ESM 格式,避免 UMD 冲突
64
- },
65
- },
66
41
  },
67
42
  css: {
68
43
  preprocessorOptions: {
69
- scss: {
44
+ scss: {
70
45
  api: "modern-compiler",
71
- silenceDeprecations: ["legacy-js-api"],
72
- },
46
+ silenceDeprecations: ['legacy-js-api']
47
+ },
73
48
  },
74
49
  },
75
50
  plugins: [vue(), vueJsx(), importToConst(), cssInjectedByJsPlugin()],