@easy-editor/materials-dashboard-text 0.0.9 → 0.0.10
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/.vite/plugins/vite-plugin-material-dev.ts +218 -0
- package/CHANGELOG.md +6 -0
- package/dist/component.esm.js +1 -1
- package/dist/component.js +1 -1
- package/dist/index.cjs +0 -69
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +0 -69
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -70
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/meta.esm.js +1 -70
- package/dist/meta.esm.js.map +1 -1
- package/dist/meta.js +1 -70
- package/dist/meta.js.map +1 -1
- package/dist/meta.min.js +1 -1
- package/dist/meta.min.js.map +1 -1
- package/package.json +1 -1
- package/vite.config.ts +64 -0
package/vite.config.ts
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vite Configuration for Material Development
|
|
3
|
+
* 物料开发 Vite 配置
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { defineConfig } from 'vite'
|
|
7
|
+
import react from '@vitejs/plugin-react'
|
|
8
|
+
import { materialDevPlugin } from './.vite/plugins/vite-plugin-material-dev'
|
|
9
|
+
|
|
10
|
+
export default defineConfig({
|
|
11
|
+
plugins: [
|
|
12
|
+
react(),
|
|
13
|
+
materialDevPlugin({
|
|
14
|
+
entry: '/src/index.tsx',
|
|
15
|
+
}),
|
|
16
|
+
],
|
|
17
|
+
|
|
18
|
+
server: {
|
|
19
|
+
port: 5001,
|
|
20
|
+
host: 'localhost',
|
|
21
|
+
cors: true,
|
|
22
|
+
// HMR 配置
|
|
23
|
+
hmr: {
|
|
24
|
+
port: 5001,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
// 优化依赖处理
|
|
29
|
+
optimizeDeps: {
|
|
30
|
+
// 排除这些依赖,让它们从平台端加载
|
|
31
|
+
exclude: ['@easy-editor/core', '@easy-editor/materials-shared'],
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
// 构建配置(用于生产环境,开发时不影响)
|
|
35
|
+
build: {
|
|
36
|
+
lib: {
|
|
37
|
+
entry: 'src/index.tsx',
|
|
38
|
+
formats: ['es'],
|
|
39
|
+
fileName: 'index',
|
|
40
|
+
},
|
|
41
|
+
rollupOptions: {
|
|
42
|
+
// 外部依赖不打包
|
|
43
|
+
external: ['react', 'react-dom', '@easy-editor/core', '@easy-editor/materials-shared'],
|
|
44
|
+
output: {
|
|
45
|
+
globals: {
|
|
46
|
+
react: 'React',
|
|
47
|
+
'react-dom': 'ReactDOM',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
// 解析配置
|
|
54
|
+
resolve: {
|
|
55
|
+
// 确保使用相同的 React 实例
|
|
56
|
+
dedupe: ['react', 'react-dom'],
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
// esbuild 配置
|
|
60
|
+
esbuild: {
|
|
61
|
+
// 保留 JSX 注释,便于调试
|
|
62
|
+
jsx: 'automatic',
|
|
63
|
+
},
|
|
64
|
+
})
|