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 7
7
8
8
import * as fs from 'fs' ;
9
9
10
+ import * as path from 'path' ;
11
+
10
12
const BUILD_DIR = 'build' ;
11
13
const ASSETS = [ 'README.md' , 'LICENSE' , 'package.json' , '.npmignore' ] ;
12
14
const ENTRY_POINTS = [ 'main' , 'module' , 'types' ] ;
@@ -24,11 +26,11 @@ ASSETS.forEach(asset => {
24
26
console . error ( `Asset ${ asset } does not exist.` ) ;
25
27
process . exit ( 1 ) ;
26
28
}
27
- fs . copyFileSync ( asset , ` ${ BUILD_DIR } / ${ asset } ` ) ;
29
+ fs . copyFileSync ( asset , path . join ( BUILD_DIR , asset ) ) ;
28
30
} ) ;
29
31
30
32
// package.json modifications
31
- const packageJsonPath = ` ${ process . cwd ( ) } / ${ BUILD_DIR } / package.json` ;
33
+ const packageJsonPath = path . join ( process . cwd ( ) , BUILD_DIR , ' package.json' ) ;
32
34
const pkg : { [ key : string ] : string } = require ( packageJsonPath ) ;
33
35
34
36
// 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