lu-lowcode-package-form 0.5.2 → 0.6.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lu-lowcode-package-form",
3
- "version": "0.5.2",
3
+ "version": "0.6.2",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^5.3.7",
6
6
  "@testing-library/jest-dom": "^5.17.0",
@@ -9,7 +9,8 @@
9
9
  "antd": "^5.18.0",
10
10
  "web-vitals": "^2.1.4"
11
11
  },
12
- "main": "dist/index.umd.js",
12
+ "main": "dist/index.cjs.js",
13
+ "module": "dist/index.es.js",
13
14
  "scripts": {
14
15
  "start": "react-scripts start",
15
16
  "build": "vite build",
@@ -42,6 +43,7 @@
42
43
  "@babel/core": "^7.24.7",
43
44
  "@babel/preset-env": "^7.24.7",
44
45
  "@babel/preset-react": "^7.24.7",
46
+ "@rollup/plugin-babel": "^6.0.4",
45
47
  "@vitejs/plugin-react": "^4.3.1",
46
48
  "autoprefixer": "^10.4.19",
47
49
  "babel-loader": "^9.1.3",
package/vite.config.js CHANGED
@@ -2,12 +2,14 @@ import { defineConfig } from 'vite';
2
2
  import react from '@vitejs/plugin-react';
3
3
  import tailwindcss from 'tailwindcss'
4
4
  import autoprefixer from 'autoprefixer'
5
+ import babel from '@rollup/plugin-babel';
5
6
 
6
7
  export default defineConfig({
7
8
  build: {
8
9
  lib: {
9
10
  entry: 'src/components/index.jsx', // 入口文件
10
11
  name: 'luLowcodePackageForm',
12
+ formats: ['es', 'cjs'], // 指定生成的模块格式
11
13
  fileName: (format) => `index.${format}.js`,
12
14
  },
13
15
  rollupOptions: {
@@ -30,5 +32,11 @@ export default defineConfig({
30
32
  },
31
33
  plugins: [
32
34
  react(),
35
+ babel({
36
+ babelHelpers: 'bundled',
37
+ exclude: 'node_modules/**',
38
+ presets: ['@babel/preset-env', '@babel/preset-react'],
39
+ plugins: ['@babel/plugin-proposal-nullish-coalescing-operator'],
40
+ }),
33
41
  ],
34
42
  });