Skip to content

Commit

Permalink
Replace custom loader with @node-loaders/tsx
Browse files Browse the repository at this point in the history
We need a loader to load our JSX test file. We currently use a local
script, but there are several packages that do this. We don’t need to
maintain our own.

This replaces our custom loader with `@nodejs-loaders/tsx` by the
Node.js team.
  • Loading branch information
remcohaszing committed Mar 6, 2025
1 parent ad7f37f commit 59aba31
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 92 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@
},
"description": "React component to render markdown",
"devDependencies": {
"@nodejs-loaders/tsx": "^1.0.0",
"@testing-library/react": "^16.0.0",
"@types/node": "^22.0.0",
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0",
"c8": "^10.0.0",
"concat-stream": "^2.0.0",
"esbuild": "^0.25.0",
"eslint-plugin-react": "^7.0.0",
"global-jsdom": "^26.0.0",
"prettier": "^3.0.0",
Expand Down Expand Up @@ -133,8 +133,8 @@
"scripts": {
"build": "tsc --build --clean && tsc --build && type-coverage",
"format": "remark --frail --output --quiet -- . && prettier --log-level warn --write -- . && xo --fix",
"test-api": "node --conditions development --experimental-loader=./script/load-jsx.js --no-warnings test.jsx",
"test-coverage": "c8 --100 --exclude script/ --reporter lcov -- npm run test-api",
"test-api": "node --conditions development --experimental-loader=@nodejs-loaders/tsx --no-warnings test.jsx",
"test-coverage": "c8 --100 --reporter lcov -- npm run test-api",
"test": "npm run build && npm run format && npm run test-coverage"
},
"sideEffects": false,
Expand Down
89 changes: 0 additions & 89 deletions script/load-jsx.js

This file was deleted.

0 comments on commit 59aba31

Please sign in to comment.