File tree 4 files changed +10
-185
lines changed
4 files changed +10
-185
lines changed Original file line number Diff line number Diff line change 1
1
import { exec } from 'node:child_process'
2
2
import { promisify } from 'node:util'
3
+ import { env } from 'node:process'
4
+
3
5
import { defineBuildConfig } from 'unbuild'
4
6
import builtins from 'builtin-modules'
5
7
@@ -37,7 +39,7 @@ export default defineBuildConfig({
37
39
output : {
38
40
dir : './dist' ,
39
41
format : 'cjs' ,
40
- sourcemap : true ,
42
+ sourcemap : env . NODE_ENV === 'development' ? 'inline' : false ,
41
43
entryFileNames : 'main.js' ,
42
44
} ,
43
45
// required for unocss, ofetch, etc.
@@ -47,13 +49,9 @@ export default defineBuildConfig({
47
49
inlineDependencies : true ,
48
50
} ,
49
51
hooks : {
50
- 'build:before' : async ( ) => {
51
- await execAsync ( 'rm -rf ./main.js' )
52
- await execAsync ( 'rm -rf ./main.js.map' )
53
- } ,
54
52
'build:done' : async ( ) => {
53
+ await execAsync ( 'rm -rf ./main.js' )
55
54
await execAsync ( 'cp ./dist/main.js ./main.js' )
56
- await execAsync ( 'cp ./dist/main.js.map ./main.js.map' )
57
55
} ,
58
56
} ,
59
57
} )
Original file line number Diff line number Diff line change 22
22
" dist"
23
23
],
24
24
"scripts" : {
25
+ "build:dev" : " NODE_ENV=development unbuild" ,
25
26
"build" : " unbuild" ,
26
27
"lint" : " eslint --cache ."
27
28
},
31
32
"@types/node" : " ^20.14.10" ,
32
33
"builtin-modules" : " ^3.3.0" ,
33
34
"eslint" : " ^8.57.0" ,
34
- "hast-util-to-html" : " ^9.0.1" ,
35
35
"obsidian" : " ^1.5.7" ,
36
- "rehype-format" : " ^5.0.0" ,
37
- "rehype-minify-whitespace" : " ^6.0.0" ,
38
36
"rehype-raw" : " ^7.0.0" ,
39
37
"rehype-stringify" : " ^10.0.0" ,
40
38
"remark-parse" : " ^11.0.0" ,
44
42
"unified" : " ^11.0.5" ,
45
43
"unist-util-remove" : " ^4.0.0" ,
46
44
"vue" : " ^3.4.31"
47
- },
48
- "dependencies" : {
49
- "remark-retext" : " ^6.0.0"
50
45
}
51
46
}
You can’t perform that action at this time.
0 commit comments