Skip to content

Commit 0fa1506

Browse files
committed
add build dir to @sentry/serverless
1 parent 986de3b commit 0fa1506

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

packages/serverless/.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/**/*
9+
!/types/**/*

packages/serverless/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"engines": {
1010
"node": ">=10"
1111
},
12-
"main": "dist/index.js",
13-
"module": "esm/index.js",
12+
"main": "build/dist/index.js",
13+
"module": "build/esm/index.js",
1414
"types": "build/types/index.d.ts",
1515
"publishConfig": {
1616
"access": "public"
@@ -52,7 +52,7 @@
5252
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
5353
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
5454
"build:types:watch": "tsc -p tsconfig.types.json --watch",
55-
"build:npm": "npm pack",
55+
"build:npm": "ts-node ../../scripts/prepack.ts -noBundles && npm pack ./build",
5656
"circularDepCheck": "madge --circular src/index.ts",
5757
"clean": "rimraf dist esm build dist-awslambda-layer coverage",
5858
"fix": "run-s fix:eslint fix:prettier",

packages/serverless/scripts/build-awslambda-layer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ async function collectPackages(cwd, packages = {}) {
6969

7070
async function main() {
7171
const workDir = path.resolve(__dirname, '..'); // packages/serverless directory
72-
const distRequirements = path.resolve(workDir, 'dist');
72+
const distRequirements = path.resolve(workDir, 'build', 'dist');
7373
if (!fs.existsSync(distRequirements)) {
7474
console.log(`The path ${distRequirements} must exist.`);
7575
return;

packages/serverless/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/serverless/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
}

0 commit comments

Comments
 (0)