1+ /* eslint-disable no-console */
12/*
23 This script prepares the central `build` directory for NPM package creation.
34 It first copies all non-code files into the `build` directory, including `package.json`, which
@@ -47,19 +48,20 @@ ASSETS.forEach(asset => {
4748const tmpCopyBundles = ! process . argv . includes ( '-skipBundleCopy' ) ;
4849if ( tmpCopyBundles ) {
4950 const npmTmpBundlesPath = path . resolve ( NPM_BUILD_DIR , 'build' ) ;
50- const cdnBundlesPaht = path . resolve ( 'build' , 'bundles' ) ;
51+ const cdnBundlesPath = path . resolve ( 'build' , 'bundles' ) ;
5152 try {
5253 if ( ! fs . existsSync ( npmTmpBundlesPath ) ) {
5354 fs . mkdirSync ( npmTmpBundlesPath ) ;
5455 }
55- fse . copy ( cdnBundlesPaht , npmTmpBundlesPath ) ;
56+ void fse . copy ( cdnBundlesPath , npmTmpBundlesPath ) ;
5657 } catch ( error ) {
5758 console . error ( `Error while tmp copying CDN bundles to ${ NPM_BUILD_DIR } ` ) ;
5859 process . exit ( 1 ) ;
5960 }
6061}
6162// package.json modifications
6263const packageJsonPath = path . resolve ( NPM_BUILD_DIR , 'package.json' ) ;
64+ // eslint-disable-next-line @typescript-eslint/no-var-requires
6365const pkgJson : { [ key : string ] : unknown } = require ( packageJsonPath ) ;
6466
6567// modify entry points to point to correct paths (i.e. strip out the build directory)
@@ -75,7 +77,7 @@ delete pkgJson.jest;
7577try {
7678 fs . writeFileSync ( packageJsonPath , JSON . stringify ( pkgJson , null , 2 ) ) ;
7779} catch ( error ) {
78- console . error ( ` Error while writing package.json to disk` ) ;
80+ console . error ( ' Error while writing package.json to disk' ) ;
7981 process . exit ( 1 ) ;
8082}
8183
0 commit comments