File tree Expand file tree Collapse file tree 2 files changed +8
-11
lines changed Expand file tree Collapse file tree 2 files changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -16,12 +16,9 @@ var config = {
16
16
//watch: process.argv.includes("--watch"),
17
17
} ;
18
18
19
- let build = true ;
20
19
let buildmode = process . argv . length > 2 ? process . argv [ 2 ] : 'default' ;
20
+ let bundle = process . argv . length > 3 && process . argv [ 3 ] == 'bundle' ;
21
21
switch ( buildmode ) {
22
- case 'bundleweb' :
23
- build = false ;
24
- break ;
25
22
case 'cmd' :
26
23
config = {
27
24
entryPoints : [ "igc2kmz/cmdwrapper.ts" ] ,
@@ -47,11 +44,11 @@ switch (buildmode) {
47
44
break ;
48
45
}
49
46
50
- if ( build ) {
51
- await esbuild . build ( {
52
- ... config ,
53
- } ) . catch ( ( ) => process . exit ( 1 ) )
54
- } else {
47
+ await esbuild . build ( {
48
+ ... config ,
49
+ } ) . catch ( ( ) => process . exit ( 1 ) ) ;
50
+
51
+ if ( bundle ) {
55
52
// BUNDLE
56
53
const regtoreplace = / < s c r i p t [ \s \r \n ] + s r c \s * = \s * (?: " | ' ) ( [ ^ " ' ] + ) (?: " | ' ) [ \s \r \n ] * > / i;
57
54
let htmli2k = fs . readFileSync ( './igc2kmz.html' , { encoding : 'utf8' , flag : 'r' } ) ;
@@ -69,4 +66,4 @@ if (build) {
69
66
}
70
67
}
71
68
fs . writeFileSync ( './dist/igc2kmz_spa.html' , htmli2k ) ;
72
- }
69
+ }
Original file line number Diff line number Diff line change 20
20
"build" : " node ./build.mjs cmd" ,
21
21
"buildweb" : " node ./build.mjs" ,
22
22
"minify" : " node ./build.mjs minify" ,
23
- "bundleweb" : " npm run minify && node ./build.mjs bundleweb " ,
23
+ "bundleweb" : " node ./build.mjs minify bundle " ,
24
24
"buildall" : " npm run build && npm run buildweb && npm run bundleweb"
25
25
},
26
26
"devDependencies" : {
You can’t perform that action at this time.
0 commit comments