Skip to content

Commit 037a3ad

Browse files
committed
add build dir to @sentry/nextjs
1 parent 329e033 commit 037a3ad

File tree

5 files changed

+15
-10
lines changed

5 files changed

+15
-10
lines changed

packages/nextjs/.npmignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
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+
# prepack script `sentry-javascript/scripts/prepack.ts`.
4+
15
*
6+
27
!/dist/**/*
38
!/esm/**/*
4-
!/build/types/**/*
9+
!/types/**/*

packages/nextjs/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
"engines": {
1010
"node": ">=6"
1111
},
12-
"main": "./dist/index.server.js",
13-
"module": "./esm/index.server.js",
14-
"browser": "./esm/index.client.js",
15-
"types": "./build/types/index.server.d.ts",
12+
"main": "build/dist/index.server.js",
13+
"module": "build/esm/index.server.js",
14+
"browser": "build/esm/index.client.js",
15+
"types": "build/types/index.server.d.ts",
1616
"publishConfig": {
1717
"access": "public"
1818
},
@@ -55,9 +55,9 @@
5555
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
5656
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
5757
"build:types:watch": "tsc -p tsconfig.types.json --watch",
58-
"build:npm": "npm pack",
58+
"build:npm": "ts-node ../../scripts/prepack.ts -noBundles && npm pack ./build",
5959
"circularDepCheck": "madge --circular src/index.client.ts && madge --circular --exclude 'config/types\\.ts' src/index.server.ts # see https://github.com/pahen/madge/issues/306",
60-
"clean": "rimraf dist esm coverage *.js *.js.map *.d.ts",
60+
"clean": "rimraf dist esm build coverage *.js *.js.map *.d.ts",
6161
"fix": "run-s fix:eslint fix:prettier",
6262
"fix:eslint": "eslint . --format stylish --fix",
6363
"fix:prettier": "prettier --write \"{src,test,scripts}/**/*.ts\"",

packages/nextjs/tsconfig.cjs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

44
"compilerOptions": {
55
"module": "commonjs",
6-
"outDir": "dist"
6+
"outDir": "build/dist"
77
}
88
}

packages/nextjs/tsconfig.esm.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

44
"compilerOptions": {
55
"module": "es6",
6-
"outDir": "esm"
6+
"outDir": "build/esm"
77
}
88
}

scripts/prepack.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const NPM_BUILD_DIR = 'build/npm';
1414
const BUILD_DIR = 'build';
1515

1616
const ASSETS = ['README.md', 'LICENSE', 'package.json', '.npmignore'];
17-
const ENTRY_POINTS = ['main', 'module', 'types'];
17+
const ENTRY_POINTS = ['main', 'module', 'types', 'browser'];
1818

1919
const packageWithBundles = !process.argv.includes('-noBundles');
2020
const buildDir = packageWithBundles ? NPM_BUILD_DIR : BUILD_DIR;

0 commit comments

Comments
 (0)