Skip to content

Commit 245dfad

Browse files
committed
fix(build): emit "with" import attribute key in rollup configs
Node 24 dropped support for the legacy `assert { type: "json" }` import attribute syntax, but rollup still defaults `importAttributesKey` to `assert` when it bundles the TypeScript config file. That makes every `rollup -c rollup.config.ts` build fail with `SyntaxError: Unexpected identifier 'assert'`. Pass `--configImportAttributesKey with` in the build scripts and normalize the one config still written with `assert`.
1 parent e3224e7 commit 245dfad

6 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎packages/benchmark.js-plugin/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"dist"
1616
],
1717
"scripts": {
18-
"build": "NODE_NO_WARNINGS=1 rollup -c rollup.config.ts --configPlugin typescript",
18+
"build": "NODE_NO_WARNINGS=1 rollup -c rollup.config.ts --configPlugin typescript --configImportAttributesKey with",
1919
"test": "jest --passWithNoTests --silent",
2020
"test/integ": "jest --passWithNoTests --silent -c jest.config.integ.js",
2121
"lint": "eslint .",

‎packages/core/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"types": "dist/index.d.ts",
1717
"gypfile": true,
1818
"scripts": {
19-
"build": "NODE_NO_WARNINGS=1 rollup -c rollup.config.ts --configPlugin typescript",
19+
"build": "NODE_NO_WARNINGS=1 rollup -c rollup.config.ts --configPlugin typescript --configImportAttributesKey with",
2020
"build-native-addon": "prebuildify --napi --strip",
2121
"build-tracer-client": "openapi --client axios --input ./tracer.spec.json --name MongoTracer --output ./src/generated/openapi",
2222
"test": "jest --passWithNoTests --silent",

‎packages/playwright-plugin/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"dist"
2323
],
2424
"scripts": {
25-
"build": "NODE_NO_WARNINGS=1 rollup -c rollup.config.ts --configPlugin typescript",
25+
"build": "NODE_NO_WARNINGS=1 rollup -c rollup.config.ts --configPlugin typescript --configImportAttributesKey with",
2626
"test": "echo 'no tests'",
2727
"test/integ": "echo 'no integ tests'",
2828
"lint": "eslint .",

‎packages/playwright-plugin/rollup.config.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { defineConfig } from "rollup";
22
import { declarationsPlugin, jsPlugins } from "../../rollup.options";
3-
import pkg from "./package.json" assert { type: "json" };
3+
import pkg from "./package.json" with { type: "json" };
44

55
const entrypoint = "src/index.ts";
66

‎packages/tinybench-plugin/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"dist"
2222
],
2323
"scripts": {
24-
"build": "NODE_NO_WARNINGS=1 rollup -c rollup.config.ts --configPlugin typescript",
24+
"build": "NODE_NO_WARNINGS=1 rollup -c rollup.config.ts --configPlugin typescript --configImportAttributesKey with",
2525
"test": "vitest --run",
2626
"test/integ": "echo 'no integ tests'",
2727
"lint": "eslint .",

‎packages/vitest-plugin/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"homepage": "https://codspeed.io",
2626
"license": "Apache-2.0",
2727
"scripts": {
28-
"build": "NODE_NO_WARNINGS=1 rollup -c rollup.config.ts --configPlugin typescript",
28+
"build": "NODE_NO_WARNINGS=1 rollup -c rollup.config.ts --configPlugin typescript --configImportAttributesKey with",
2929
"test": "vitest --run",
3030
"test/integ": "echo 'no integ tests'",
3131
"lint": "eslint .",

0 commit comments

Comments
 (0)