File tree 3 files changed +18
-8
lines changed
3 files changed +18
-8
lines changed Original file line number Diff line number Diff line change
1
+ import { exec } from 'node:child_process'
2
+ import { promisify } from 'node:util'
1
3
import { defineBuildConfig } from 'unbuild'
2
4
import builtins from 'builtin-modules'
3
5
6
+ const execAsync = promisify ( exec )
7
+
4
8
export default defineBuildConfig ( {
5
9
outDir : './dist' ,
6
10
sourcemap : true ,
@@ -20,11 +24,6 @@ export default defineBuildConfig({
20
24
'@lezer/common' ,
21
25
'@lezer/highlight' ,
22
26
'@lezer/lr' ,
23
- // UnoCSS
24
- '@iconify/utils/lib/loader/fs' ,
25
- '@iconify/utils/lib/loader/install-pkg' ,
26
- '@iconify/utils/lib/loader/node-loader' ,
27
- '@iconify/utils/lib/loader/node-loaders' ,
28
27
// Builtins
29
28
...builtins ,
30
29
] ,
@@ -44,4 +43,14 @@ export default defineBuildConfig({
44
43
// by esbuild
45
44
inlineDependencies : true ,
46
45
} ,
46
+ hooks : {
47
+ 'build:before' : async ( ) => {
48
+ await execAsync ( 'rm -rf ./main.js' )
49
+ await execAsync ( 'rm -rf ./main.js.map' )
50
+ } ,
51
+ 'build:done' : async ( ) => {
52
+ await execAsync ( 'cp ./dist/main.js ./main.js' )
53
+ await execAsync ( 'cp ./dist/main.js.map ./main.js.map' )
54
+ } ,
55
+ } ,
47
56
} )
Original file line number Diff line number Diff line change @@ -5,9 +5,12 @@ dictionaries: []
5
5
words :
6
6
- antfu
7
7
- codemirror
8
+ - collab
9
+ - lezer
8
10
- nolebase
9
11
- Nólëbase
10
12
- ofetch
13
+ - unocss
11
14
- vueuse
12
15
ignoreWords : []
13
16
import : []
Original file line number Diff line number Diff line change 26
26
" dist"
27
27
],
28
28
"scripts" : {
29
- "cleanup" : " rm -rf ./main.js && rm -rf ./main.js.map" ,
30
- "build" : " unbuild && pnpm run cleanup && pnpm run copy" ,
31
- "copy" : " cp ./dist/main.js ./main.js && cp ./dist/main.js.map ./main.js.map" ,
29
+ "build" : " unbuild" ,
32
30
"lint" : " eslint --cache ."
33
31
},
34
32
"devDependencies" : {
You can’t perform that action at this time.
0 commit comments