@easy-editor/materials-dashboard-number-flip 0.0.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/.vite/plugins/vite-plugin-external-deps.ts +224 -0
- package/.vite/plugins/vite-plugin-material-dev.ts +218 -0
- package/CHANGELOG.md +7 -0
- package/LICENSE +9 -0
- package/dist/component.esm.js +167 -0
- package/dist/component.esm.js.map +1 -0
- package/dist/component.js +176 -0
- package/dist/component.js.map +1 -0
- package/dist/component.min.js +2 -0
- package/dist/component.min.js.map +1 -0
- package/dist/index.cjs +573 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.esm.js +570 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +578 -0
- package/dist/index.js.map +1 -0
- package/dist/index.min.js +2 -0
- package/dist/index.min.js.map +1 -0
- package/dist/meta.esm.js +407 -0
- package/dist/meta.esm.js.map +1 -0
- package/dist/meta.js +418 -0
- package/dist/meta.js.map +1 -0
- package/dist/meta.min.js +2 -0
- package/dist/meta.min.js.map +1 -0
- package/dist/src/component.d.ts +43 -0
- package/dist/src/configure.d.ts +7 -0
- package/dist/src/constants.d.ts +16 -0
- package/dist/src/index.d.ts +6 -0
- package/dist/src/meta.d.ts +7 -0
- package/dist/src/snippets.d.ts +7 -0
- package/package.json +65 -0
- package/rollup.config.js +222 -0
- package/src/component.module.css +56 -0
- package/src/component.tsx +179 -0
- package/src/configure.ts +342 -0
- package/src/constants.ts +18 -0
- package/src/index.tsx +7 -0
- package/src/meta.ts +28 -0
- package/src/snippets.ts +80 -0
- package/src/type.d.ts +8 -0
- package/tsconfig.build.json +12 -0
- package/tsconfig.json +9 -0
- package/tsconfig.test.json +7 -0
- package/vite.config.ts +54 -0
package/src/configure.ts
ADDED
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Number Flip Configure
|
|
3
|
+
* 数字翻牌组件配置
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { Configure } from '@easy-editor/core'
|
|
7
|
+
|
|
8
|
+
export const configure: Configure = {
|
|
9
|
+
props: [
|
|
10
|
+
{
|
|
11
|
+
type: 'group',
|
|
12
|
+
title: '属性',
|
|
13
|
+
setter: 'TabSetter',
|
|
14
|
+
items: [
|
|
15
|
+
{
|
|
16
|
+
type: 'group',
|
|
17
|
+
key: 'config',
|
|
18
|
+
title: '配置',
|
|
19
|
+
setter: {
|
|
20
|
+
componentName: 'CollapseSetter',
|
|
21
|
+
props: {
|
|
22
|
+
icon: false,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
items: [
|
|
26
|
+
// 基础配置
|
|
27
|
+
{
|
|
28
|
+
name: 'id',
|
|
29
|
+
title: 'ID',
|
|
30
|
+
setter: 'NodeIdSetter',
|
|
31
|
+
extraProps: {
|
|
32
|
+
// @ts-expect-error label is not a valid extra prop
|
|
33
|
+
label: false,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'title',
|
|
38
|
+
title: '标题',
|
|
39
|
+
setter: 'StringSetter',
|
|
40
|
+
extraProps: {
|
|
41
|
+
getValue(target) {
|
|
42
|
+
return target.getExtraPropValue('title')
|
|
43
|
+
},
|
|
44
|
+
setValue(target, value) {
|
|
45
|
+
target.setExtraPropValue('title', value)
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
type: 'group',
|
|
51
|
+
title: '基础属性',
|
|
52
|
+
setter: {
|
|
53
|
+
componentName: 'CollapseSetter',
|
|
54
|
+
props: {
|
|
55
|
+
icon: false,
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
items: [
|
|
59
|
+
{
|
|
60
|
+
name: 'rect',
|
|
61
|
+
title: '位置尺寸',
|
|
62
|
+
setter: 'RectSetter',
|
|
63
|
+
extraProps: {
|
|
64
|
+
getValue(target) {
|
|
65
|
+
return target.getExtraPropValue('$dashboard.rect')
|
|
66
|
+
},
|
|
67
|
+
setValue(target, value) {
|
|
68
|
+
target.setExtraPropValue('$dashboard.rect', value)
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
// 组件配置
|
|
75
|
+
{
|
|
76
|
+
type: 'group',
|
|
77
|
+
title: '数值',
|
|
78
|
+
setter: {
|
|
79
|
+
componentName: 'CollapseSetter',
|
|
80
|
+
props: {
|
|
81
|
+
icon: false,
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
items: [
|
|
85
|
+
{
|
|
86
|
+
name: 'value',
|
|
87
|
+
title: '数值',
|
|
88
|
+
setter: 'NumberSetter',
|
|
89
|
+
extraProps: {
|
|
90
|
+
defaultValue: 0,
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: 'decimals',
|
|
95
|
+
title: '小数位数',
|
|
96
|
+
setter: 'NumberSetter',
|
|
97
|
+
extraProps: {
|
|
98
|
+
defaultValue: 0,
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: 'separator',
|
|
103
|
+
title: '千分位分隔',
|
|
104
|
+
setter: 'SwitchSetter',
|
|
105
|
+
extraProps: {
|
|
106
|
+
defaultValue: true,
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
name: 'prefix',
|
|
111
|
+
title: '前缀',
|
|
112
|
+
setter: 'StringSetter',
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: 'suffix',
|
|
116
|
+
title: '后缀',
|
|
117
|
+
setter: 'StringSetter',
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
type: 'group',
|
|
123
|
+
title: '趋势',
|
|
124
|
+
setter: {
|
|
125
|
+
componentName: 'CollapseSetter',
|
|
126
|
+
props: {
|
|
127
|
+
icon: false,
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
items: [
|
|
131
|
+
{
|
|
132
|
+
name: 'trendEnable',
|
|
133
|
+
title: '显示趋势',
|
|
134
|
+
setter: 'SwitchSetter',
|
|
135
|
+
extraProps: {
|
|
136
|
+
defaultValue: false,
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
name: 'trendValue',
|
|
141
|
+
title: '趋势值',
|
|
142
|
+
setter: 'NumberSetter',
|
|
143
|
+
extraProps: {
|
|
144
|
+
defaultValue: 0,
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
name: 'trendType',
|
|
149
|
+
title: '趋势类型',
|
|
150
|
+
setter: {
|
|
151
|
+
componentName: 'SegmentedSetter',
|
|
152
|
+
props: {
|
|
153
|
+
options: [
|
|
154
|
+
{ label: '上升', value: 'up' },
|
|
155
|
+
{ label: '下降', value: 'down' },
|
|
156
|
+
{ label: '持平', value: 'flat' },
|
|
157
|
+
],
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
extraProps: {
|
|
161
|
+
defaultValue: 'up',
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
name: 'trendSuffix',
|
|
166
|
+
title: '趋势后缀',
|
|
167
|
+
setter: 'StringSetter',
|
|
168
|
+
extraProps: {
|
|
169
|
+
defaultValue: '%',
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
],
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
type: 'group',
|
|
176
|
+
title: '样式',
|
|
177
|
+
setter: {
|
|
178
|
+
componentName: 'CollapseSetter',
|
|
179
|
+
props: {
|
|
180
|
+
icon: false,
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
items: [
|
|
184
|
+
{
|
|
185
|
+
name: 'fontSize',
|
|
186
|
+
title: '字体大小',
|
|
187
|
+
setter: 'NumberSetter',
|
|
188
|
+
extraProps: {
|
|
189
|
+
defaultValue: 48,
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
name: 'fontFamily',
|
|
194
|
+
title: '字体类型',
|
|
195
|
+
setter: {
|
|
196
|
+
componentName: 'SelectSetter',
|
|
197
|
+
props: {
|
|
198
|
+
options: [
|
|
199
|
+
{ label: '数码字体', value: 'digital' },
|
|
200
|
+
{ label: '默认字体', value: 'default' },
|
|
201
|
+
],
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
extraProps: {
|
|
205
|
+
defaultValue: 'digital',
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
name: 'color',
|
|
210
|
+
title: '颜色',
|
|
211
|
+
setter: 'ColorSetter',
|
|
212
|
+
extraProps: {
|
|
213
|
+
defaultValue: '#00d4ff',
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
name: 'glowIntensity',
|
|
218
|
+
title: '发光强度',
|
|
219
|
+
setter: {
|
|
220
|
+
componentName: 'NumberSetter',
|
|
221
|
+
props: {
|
|
222
|
+
min: 0,
|
|
223
|
+
max: 2,
|
|
224
|
+
step: 0.1,
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
extraProps: {
|
|
228
|
+
defaultValue: 0.5,
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
],
|
|
232
|
+
},
|
|
233
|
+
],
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
type: 'group',
|
|
237
|
+
key: 'data',
|
|
238
|
+
title: '数据',
|
|
239
|
+
items: [
|
|
240
|
+
{
|
|
241
|
+
name: 'dataBinding',
|
|
242
|
+
title: '数据绑定',
|
|
243
|
+
setter: 'DataBindingSetter',
|
|
244
|
+
},
|
|
245
|
+
],
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
type: 'group',
|
|
249
|
+
key: 'advanced',
|
|
250
|
+
title: '高级',
|
|
251
|
+
items: [
|
|
252
|
+
{
|
|
253
|
+
name: 'condition',
|
|
254
|
+
title: '显隐控制',
|
|
255
|
+
setter: 'SwitchSetter',
|
|
256
|
+
extraProps: {
|
|
257
|
+
defaultValue: true,
|
|
258
|
+
supportVariable: true,
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
type: 'group',
|
|
263
|
+
title: '动画',
|
|
264
|
+
setter: {
|
|
265
|
+
componentName: 'CollapseSetter',
|
|
266
|
+
props: {
|
|
267
|
+
icon: false,
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
items: [
|
|
271
|
+
{
|
|
272
|
+
name: 'animationEnable',
|
|
273
|
+
title: '启用动画',
|
|
274
|
+
setter: 'SwitchSetter',
|
|
275
|
+
extraProps: {
|
|
276
|
+
defaultValue: true,
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
name: 'animationType',
|
|
281
|
+
title: '动画类型',
|
|
282
|
+
setter: {
|
|
283
|
+
componentName: 'SegmentedSetter',
|
|
284
|
+
props: {
|
|
285
|
+
options: [
|
|
286
|
+
{ label: '滚动', value: 'scroll' },
|
|
287
|
+
{ label: '翻转', value: 'flip' },
|
|
288
|
+
{ label: '渐变', value: 'fade' },
|
|
289
|
+
],
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
extraProps: {
|
|
293
|
+
defaultValue: 'scroll',
|
|
294
|
+
},
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
name: 'animationDuration',
|
|
298
|
+
title: '动画时长',
|
|
299
|
+
setter: {
|
|
300
|
+
componentName: 'SliderSetter',
|
|
301
|
+
props: {
|
|
302
|
+
min: 0,
|
|
303
|
+
max: 3000,
|
|
304
|
+
step: 100,
|
|
305
|
+
suffix: 'ms',
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
extraProps: {
|
|
309
|
+
defaultValue: 1000,
|
|
310
|
+
},
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
name: 'animationEasing',
|
|
314
|
+
title: '缓动函数',
|
|
315
|
+
setter: {
|
|
316
|
+
componentName: 'SelectSetter',
|
|
317
|
+
props: {
|
|
318
|
+
options: [
|
|
319
|
+
{ label: '线性', value: 'linear' },
|
|
320
|
+
{ label: '缓入', value: 'ease-in' },
|
|
321
|
+
{ label: '缓出', value: 'ease-out' },
|
|
322
|
+
{ label: '缓入缓出', value: 'ease-in-out' },
|
|
323
|
+
],
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
extraProps: {
|
|
327
|
+
defaultValue: 'ease-out',
|
|
328
|
+
},
|
|
329
|
+
},
|
|
330
|
+
],
|
|
331
|
+
},
|
|
332
|
+
],
|
|
333
|
+
},
|
|
334
|
+
],
|
|
335
|
+
},
|
|
336
|
+
],
|
|
337
|
+
component: {},
|
|
338
|
+
supports: {},
|
|
339
|
+
advanced: {},
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
export default configure
|
package/src/constants.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 物料常量配置
|
|
3
|
+
* 统一管理全局变量名等配置,确保 meta.ts 和 rollup.config.js 使用相同的值
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* UMD 全局变量基础名称
|
|
8
|
+
* 用于构建:
|
|
9
|
+
* - 元数据:${GLOBAL_NAME}Meta (例如: EasyEditorMaterialsStatisticNumberMeta)
|
|
10
|
+
* - 组件:${GLOBAL_NAME}Component (例如: EasyEditorMaterialsStatisticNumberComponent)
|
|
11
|
+
* - 完整构建:${GLOBAL_NAME} (例如: EasyEditorMaterialsStatisticNumber)
|
|
12
|
+
*/
|
|
13
|
+
export const COMPONENT_NAME = 'EasyEditorMaterialsNumberFlip'
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 包名
|
|
17
|
+
*/
|
|
18
|
+
export const PACKAGE_NAME = '@easy-editor/materials-dashboard-number-flip'
|
package/src/index.tsx
ADDED
package/src/meta.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Number Flip Meta
|
|
3
|
+
* 数字翻牌组件元数据
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { ComponentMetadata } from '@easy-editor/core'
|
|
7
|
+
import { MaterialGroup } from '@easy-editor/materials-shared'
|
|
8
|
+
import { COMPONENT_NAME, PACKAGE_NAME } from './constants'
|
|
9
|
+
import configure from './configure'
|
|
10
|
+
import snippets from './snippets'
|
|
11
|
+
import pkg from '../package.json'
|
|
12
|
+
|
|
13
|
+
export const meta: ComponentMetadata = {
|
|
14
|
+
componentName: COMPONENT_NAME,
|
|
15
|
+
title: '数字翻牌',
|
|
16
|
+
group: MaterialGroup.DISPLAY,
|
|
17
|
+
devMode: 'proCode',
|
|
18
|
+
npm: {
|
|
19
|
+
package: PACKAGE_NAME,
|
|
20
|
+
version: pkg.version,
|
|
21
|
+
globalName: COMPONENT_NAME,
|
|
22
|
+
componentName: COMPONENT_NAME,
|
|
23
|
+
},
|
|
24
|
+
snippets,
|
|
25
|
+
configure,
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default meta
|
package/src/snippets.ts
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Number Flip Snippets
|
|
3
|
+
* 数字翻牌组件代码片段
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { Snippet } from '@easy-editor/core'
|
|
7
|
+
import { COMPONENT_NAME } from './constants'
|
|
8
|
+
|
|
9
|
+
export const snippets: Snippet[] = [
|
|
10
|
+
{
|
|
11
|
+
title: '数字翻牌',
|
|
12
|
+
screenshot: '',
|
|
13
|
+
schema: {
|
|
14
|
+
componentName: COMPONENT_NAME,
|
|
15
|
+
props: {
|
|
16
|
+
value: 1_234_567,
|
|
17
|
+
decimals: 0,
|
|
18
|
+
separator: true,
|
|
19
|
+
fontSize: 48,
|
|
20
|
+
fontFamily: 'digital',
|
|
21
|
+
color: '#00d4ff',
|
|
22
|
+
glowIntensity: 0.5,
|
|
23
|
+
},
|
|
24
|
+
$dashboard: {
|
|
25
|
+
rect: {
|
|
26
|
+
width: 280,
|
|
27
|
+
height: 80,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
title: '货币数字',
|
|
34
|
+
screenshot: '',
|
|
35
|
+
schema: {
|
|
36
|
+
componentName: COMPONENT_NAME,
|
|
37
|
+
props: {
|
|
38
|
+
value: 99_999.99,
|
|
39
|
+
decimals: 2,
|
|
40
|
+
separator: true,
|
|
41
|
+
prefix: '$',
|
|
42
|
+
fontSize: 42,
|
|
43
|
+
fontFamily: 'digital',
|
|
44
|
+
color: '#00ff88',
|
|
45
|
+
glowIntensity: 0.6,
|
|
46
|
+
},
|
|
47
|
+
$dashboard: {
|
|
48
|
+
rect: {
|
|
49
|
+
width: 260,
|
|
50
|
+
height: 70,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
title: '百分比',
|
|
57
|
+
screenshot: '',
|
|
58
|
+
schema: {
|
|
59
|
+
componentName: COMPONENT_NAME,
|
|
60
|
+
props: {
|
|
61
|
+
value: 87.5,
|
|
62
|
+
decimals: 1,
|
|
63
|
+
separator: false,
|
|
64
|
+
suffix: '%',
|
|
65
|
+
fontSize: 56,
|
|
66
|
+
fontFamily: 'digital',
|
|
67
|
+
color: '#ff6b6b',
|
|
68
|
+
glowIntensity: 0.8,
|
|
69
|
+
},
|
|
70
|
+
$dashboard: {
|
|
71
|
+
rect: {
|
|
72
|
+
width: 200,
|
|
73
|
+
height: 90,
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
]
|
|
79
|
+
|
|
80
|
+
export default snippets
|
package/src/type.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../../../tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"jsx": "react-jsx",
|
|
5
|
+
"strictPropertyInitialization": false,
|
|
6
|
+
"outDir": "./dist",
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"esModuleInterop": true,
|
|
9
|
+
"allowSyntheticDefaultImports": true
|
|
10
|
+
},
|
|
11
|
+
"include": ["./src"]
|
|
12
|
+
}
|
package/tsconfig.json
ADDED
package/vite.config.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
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
|
+
import { externalDeps } from './.vite/plugins/vite-plugin-external-deps'
|
|
10
|
+
|
|
11
|
+
export default defineConfig({
|
|
12
|
+
plugins: [
|
|
13
|
+
react(),
|
|
14
|
+
// 外部化 React/ReactDOM,使用父应用提供的实例
|
|
15
|
+
externalDeps({
|
|
16
|
+
externals: ['react', 'react-dom', 'react/jsx-runtime', '@easy-editor/core'],
|
|
17
|
+
globals: {
|
|
18
|
+
react: 'React',
|
|
19
|
+
'react-dom': 'ReactDOM',
|
|
20
|
+
'react/jsx-runtime': 'jsxRuntime',
|
|
21
|
+
'@easy-editor/core': 'EasyEditorCore',
|
|
22
|
+
},
|
|
23
|
+
}),
|
|
24
|
+
materialDevPlugin({
|
|
25
|
+
entry: '/src/index.tsx',
|
|
26
|
+
}),
|
|
27
|
+
],
|
|
28
|
+
server: {
|
|
29
|
+
port: 5001,
|
|
30
|
+
host: 'localhost',
|
|
31
|
+
cors: true,
|
|
32
|
+
hmr: {
|
|
33
|
+
port: 5001,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
build: {
|
|
37
|
+
target: 'esnext',
|
|
38
|
+
rollupOptions: {
|
|
39
|
+
// 确保生产构建也外部化这些依赖
|
|
40
|
+
external: ['react', 'react-dom', 'react/jsx-runtime', '@easy-editor/core'],
|
|
41
|
+
output: {
|
|
42
|
+
globals: {
|
|
43
|
+
react: 'React',
|
|
44
|
+
'react-dom': 'ReactDOM',
|
|
45
|
+
'react/jsx-runtime': 'jsxRuntime',
|
|
46
|
+
'@easy-editor/core': 'EasyEditorCore',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
resolve: {
|
|
52
|
+
dedupe: ['react', 'react-dom'],
|
|
53
|
+
},
|
|
54
|
+
})
|