File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 22
22
}
23
23
} catch ( error ) {
24
24
console . error ( `Error while looking up directory ${ BUILD_DIR } ` ) ;
25
+ process . exit ( 1 ) ;
25
26
}
26
27
27
28
// copy non-code assets to build dir
@@ -35,19 +36,19 @@ ASSETS.forEach(asset => {
35
36
fs . copyFileSync ( assetPath , path . resolve ( BUILD_DIR , asset ) ) ;
36
37
} catch ( error ) {
37
38
console . error ( `Error while copying ${ asset } to ${ BUILD_DIR } ` ) ;
39
+ process . exit ( 1 ) ;
38
40
}
39
41
} ) ;
40
42
41
43
// package.json modifications
42
44
const packageJsonPath = path . resolve ( BUILD_DIR , 'package.json' ) ;
43
- const pkgJson : { [ key : string ] : string } = require ( packageJsonPath ) ;
45
+ const pkgJson : { [ key : string ] : unknown } = require ( packageJsonPath ) ;
44
46
45
47
// modify entry points to point to correct paths (i.e. strip out the build directory)
46
48
ENTRY_POINTS . filter ( entryPoint => pkgJson [ entryPoint ] ) . forEach ( entryPoint => {
47
- pkgJson [ entryPoint ] = pkgJson [ entryPoint ] . replace ( `${ BUILD_DIR } /` , '' ) ;
49
+ pkgJson [ entryPoint ] = ( pkgJson [ entryPoint ] as string ) . replace ( `${ BUILD_DIR } /` , '' ) ;
48
50
} ) ;
49
51
50
- // TODO decide if we want this:
51
52
delete pkgJson . scripts ;
52
53
delete pkgJson . volta ;
53
54
56
57
fs . writeFileSync ( packageJsonPath , JSON . stringify ( pkgJson , null , 2 ) ) ;
57
58
} catch ( error ) {
58
59
console . error ( `Error while writing package.json to disk` ) ;
60
+ process . exit ( 1 ) ;
59
61
}
60
62
61
63
console . log ( `\nSuccessfully finished postbuild commands for ${ pkgJson . name } ` ) ;
You can’t perform that action at this time.
0 commit comments