Skip to content

Commit f020d56

Browse files
committed
use path.join() instead of template strings
1 parent 80ab1be commit f020d56

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

scripts/postbuild.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
import * as fs from 'fs';
99

10+
import * as path from 'path';
11+
1012
const BUILD_DIR = 'build';
1113
const ASSETS = ['README.md', 'LICENSE', 'package.json', '.npmignore'];
1214
const 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');
3234
const pkg: { [key: string]: string } = require(packageJsonPath);
3335

3436
// modify entry points to point to correct paths (i.e. delete the build directory)

0 commit comments

Comments
 (0)