Skip to content

Commit d66c3d4

Browse files
committed
clarify .npmignore comment, improve variable naming
1 parent 6aa4ff6 commit d66c3d4

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

packages/browser/.npmignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Info: the paths in this file are adjusted to match once this
2-
# file is copied to `./build`. This is done by a postbuild script
3-
# located in sentry-javascript/scripts/postbuild.ts
1+
# Info: the paths in this file are specified so that they align with the file
2+
# structure in `./build` where this file is copied to. This is done by the
3+
# postbuild script `sentry-javascript/scripts/postbuild.ts`.
44

55
*
66

scripts/postbuild.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,18 @@ ASSETS.forEach(asset => {
3131

3232
// package.json modifications
3333
const packageJsonPath = path.join(process.cwd(), BUILD_DIR, 'package.json');
34-
const pkg: { [key: string]: string } = require(packageJsonPath);
34+
const pkgJson: { [key: string]: string } = require(packageJsonPath);
3535

3636
// modify entry points to point to correct paths (i.e. strip out the build directory)
37-
ENTRY_POINTS.filter(entryPoint => !!pkg[entryPoint]).forEach(entryPoint => {
38-
pkg[entryPoint] = pkg[entryPoint].replace(`${BUILD_DIR}/`, '');
37+
ENTRY_POINTS.filter(entryPoint => pkgJson[entryPoint]).forEach(entryPoint => {
38+
pkgJson[entryPoint] = pkgJson[entryPoint].replace(`${BUILD_DIR}/`, '');
3939
});
4040

4141
// TODO decide if we want this:
42-
delete pkg.scripts;
43-
delete pkg.volta;
42+
delete pkgJson.scripts;
43+
delete pkgJson.volta;
4444

45-
// write modified package.json to file
46-
fs.writeFileSync(packageJsonPath, JSON.stringify(pkg, null, 2));
45+
// write modified package.json to file (pretty-printed with 2 spaces)
46+
fs.writeFileSync(packageJsonPath, JSON.stringify(pkgJson, null, 2));
4747

48-
console.log(`\nSuccessfully finished postbuild commands for ${pkg.name}`);
48+
console.log(`\nSuccessfully finished postbuild commands for ${pkgJson.name}`);

0 commit comments

Comments
 (0)