Skip to content

Commit b22d928

Browse files
committed
build: minify loader.mjs and include single node dep requirement
1 parent 99847e5 commit b22d928

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

nodejs/packages/layer/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@
88
"clean": "rimraf build/*",
99
"lint": "ESLINT_USE_FLAT_CONFIG=false eslint . --ext .ts",
1010
"lint:fix": "ESLINT_USE_FLAT_CONFIG=false eslint . --ext .ts --fix",
11-
"build": "npm run clean && npm run compile && npm run postcompile",
12-
"copy-esm-files": "copyfiles -f 'src/**/*.mjs' build/workspace && copyfiles 'test/**/*.mjs' build",
11+
"build": "npm run clean && npm run compile && npm run compile:loader && npm run postcompile",
12+
"copy-esm-files": "copyfiles -f 'build/src/**/*.mjs' build/workspace && copyfiles 'test/**/*.mjs' build",
1313
"pretest": "npm run compile:tsc",
1414
"test:cjs": "mocha 'test/**/*.spec.ts' --exclude 'test/**/*.spec.mjs' --timeout 10000",
1515
"test:esm": "mocha 'test/**/*.spec.mjs' --exclude 'test/**/*.spec.ts' --timeout 10000",
1616
"test": "npm run test:cjs && npm run test:esm",
1717
"compile:tsc": "tsc -p .",
18+
"compile:loader": "esbuild --bundle --target=es2022 --platform=node --format=esm --sourcemap --minify src/loader.mjs --outfile=build/src/loader.mjs",
1819
"compile": "esbuild --bundle --target=es2022 --platform=node --format=cjs --sourcemap --minify src/wrapper.ts --outfile=build/src/wrapper.js --external:@aws-sdk/*",
19-
"postcompile": "npm run copy-esm-files && copyfiles -f 'scripts/*' build/workspace && copyfiles -f 'build/src/*.js' build/workspace && cd build/workspace && bestzip ../layer.zip *"
20+
"postcompile": "npm run copy-esm-files && npm install import-in-the-middle --ignore-scripts --prefix build/workspace/nodejs && rm build/workspace/nodejs/package.json build/workspace/nodejs/package-lock.json && copyfiles -f 'scripts/*' build/workspace && copyfiles -f 'build/src/*.js' build/workspace && copyfiles -f 'build/src/*.map' build/workspace && cd build/workspace && bestzip ../layer.zip *"
2021
},
2122
"keywords": [
2223
"opentelemetry",

0 commit comments

Comments
 (0)