This repository was archived by the owner on Jan 9, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +28
-10
lines changed Expand file tree Collapse file tree 5 files changed +28
-10
lines changed Original file line number Diff line number Diff line change @@ -4,5 +4,4 @@ const shell = require('shelljs')
4
4
5
5
shell . exec ( 'vue-tsc --noEmit' )
6
6
shell . exec ( 'vite build --config build/vite.config.ts' )
7
- shell . exec ( 'cp ./build/index.d.ts ./dist/index.es.d.ts' )
8
- shell . exec ( 'cp ./build/index.d.ts ./dist/index.upd.d.ts' )
7
+ shell . exec ( 'vue-tsc --declaration --emitDeclarationOnly --p build/tsconfig.json' )
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ {
2
+ "extends" : " ../tsconfig.json" ,
3
+ "compilerOptions" : {
4
+ "outDir" : " ../dist" ,
5
+ },
6
+ "files" : [
7
+ " ../src/index.ts"
8
+ ]
9
+ }
Original file line number Diff line number Diff line change @@ -18,7 +18,17 @@ export default defineConfig({
18
18
lib : {
19
19
entry : resolve ( 'src/index.ts' ) ,
20
20
name : 'index' ,
21
- fileName : format => `index.${ format } .js` ,
21
+ fileName : format => {
22
+ let fileEnd = 'js'
23
+
24
+ if ( format === 'es' ) {
25
+ fileEnd = 'mjs'
26
+ } else if ( format === 'umd' ) {
27
+ fileEnd = 'cjs'
28
+ }
29
+
30
+ return `index.${ fileEnd } `
31
+ } ,
22
32
} ,
23
33
24
34
rollupOptions : {
Original file line number Diff line number Diff line change 3
3
"version" : " 1.2.0-beta.1" ,
4
4
"scripts" : {
5
5
"dev" : " vite --config dev/vite.config.ts" ,
6
- "build" : " node build/build.js"
6
+ "build" : " node build/build.js" ,
7
+ "build:types" : " vue-tsc --declaration --emitDeclarationOnly --p ./build/tsconfig.json"
7
8
},
8
- "main" : " ./dist/index.umd.js " ,
9
- "module" : " ./dist/index.es.js " ,
9
+ "main" : " ./dist/index.cjs " ,
10
+ "module" : " ./dist/index.mjs " ,
10
11
"exports" : {
11
12
"." : {
12
- "import" : " ./dist/index.es.js " ,
13
- "require" : " ./dist/index.umd.js "
13
+ "import" : " ./dist/index.mjs " ,
14
+ "require" : " ./dist/index.cjs "
14
15
},
15
16
"./dist/*" : " ./dist/*" ,
16
17
"./package.json" : " ./package.json"
17
18
},
18
- "types" : " dist/index.upd. d.ts" ,
19
+ "types" : " dist/index.d.ts" ,
19
20
"keywords" : [
20
21
" gitart" ,
21
22
" gitart-vue-dialog" ,
You can’t perform that action at this time.
0 commit comments