File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -17,9 +17,9 @@ import { globalAttrs, globalProps } from './index'
17
17
18
18
export type Mode = 'tree' | 'text'
19
19
20
+ const name = 'JsonEditorVue'
20
21
const modelValueProp = isVue3 ? 'modelValue' : 'value'
21
22
const updateModelValue = isVue3 ? 'update:modelValue' : 'input'
22
-
23
23
const boolAttrs = [
24
24
'mainMenuBar' ,
25
25
'navigationBar' ,
@@ -30,7 +30,7 @@ const boolAttrs = [
30
30
]
31
31
32
32
export default defineComponent ( {
33
- name : 'JsonEditorVue' ,
33
+ name,
34
34
props : {
35
35
[ modelValueProp ] : { } ,
36
36
mode : {
@@ -166,3 +166,5 @@ export default defineComponent({
166
166
return ( ) => h ( 'div' , { ref : 'jsonEditorRef' } )
167
167
} ,
168
168
} )
169
+
170
+ export { name }
Original file line number Diff line number Diff line change 1
1
import type { ConfigEnv , UserConfigExport } from 'vite'
2
2
import dts from 'vite-plugin-dts'
3
3
import { name } from './package.json'
4
+ import { name as globalVariableName } from './src/Component'
4
5
5
6
// https://vitejs.dev/config/
6
7
export default ( { command } : ConfigEnv ) : UserConfigExport => {
@@ -10,18 +11,16 @@ export default ({ command }: ConfigEnv): UserConfigExport => {
10
11
name,
11
12
entry : 'src/index.ts' ,
12
13
} ,
14
+ sourcemap : true ,
13
15
rollupOptions : {
14
16
external : [
15
17
'vanilla-jsoneditor' ,
16
18
'vue' ,
17
19
'vue-demi' ,
18
20
] ,
19
21
output : {
20
- // 在 UMD 构建模式下为这些外部化的依赖提供一个全局变量
21
22
globals : {
22
- 'vanilla-jsoneditor' : 'JSONEditor' ,
23
- 'vue' : 'Vue' ,
24
- 'vue-demi' : 'VueDemi' ,
23
+ [ name ] : globalVariableName ,
25
24
} ,
26
25
} ,
27
26
} ,
You can’t perform that action at this time.
0 commit comments