File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 77
88import * as fs from 'fs' ;
99
10+ import * as path from 'path' ;
11+
1012const BUILD_DIR = 'build' ;
1113const ASSETS = [ 'README.md' , 'LICENSE' , 'package.json' , '.npmignore' ] ;
1214const ENTRY_POINTS = [ 'main' , 'module' , 'types' ] ;
@@ -24,11 +26,11 @@ ASSETS.forEach(asset => {
2426 console . error ( `Asset ${ asset } does not exist.` ) ;
2527 process . exit ( 1 ) ;
2628 }
27- fs . copyFileSync ( asset , ` ${ BUILD_DIR } / ${ asset } ` ) ;
29+ fs . copyFileSync ( asset , path . join ( BUILD_DIR , asset ) ) ;
2830} ) ;
2931
3032// package.json modifications
31- const packageJsonPath = ` ${ process . cwd ( ) } / ${ BUILD_DIR } / package.json` ;
33+ const packageJsonPath = path . join ( process . cwd ( ) , BUILD_DIR , ' package.json' ) ;
3234const pkg : { [ key : string ] : string } = require ( packageJsonPath ) ;
3335
3436// modify entry points to point to correct paths (i.e. delete the build directory)
You can’t perform that action at this time.
0 commit comments