Skip to content

Fixing some issues with rollup #57

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 27, 2025
Merged

Fixing some issues with rollup #57

merged 4 commits into from
Mar 27, 2025

Conversation

andrewrlee
Copy link
Contributor

No description provided.

@andrewrlee andrewrlee requested a review from a team as a code owner March 24, 2025 17:51
@@ -32,7 +32,7 @@
},
"devDependencies": {
"@rollup/plugin-commonjs": "^28.0.2",
"@rollup/plugin-node-resolve": "^16.0.0",
"@rollup/plugin-node-resolve": "^16.0.1",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this wasn't being used which led to a warning about

(!) Unresolved dependencies
https://rollupjs.org/troubleshooting/#warning-treating-module-as-external-dependency
stream (imported by "dist/main/RestClient.d.ts")

@@ -12,13 +13,13 @@ export default [
{ file: pkg.main, format: 'cjs', sourcemap: true },
{ file: pkg.module, format: 'esm', sourcemap: true },
],
plugins: [typescript({ tsconfig: './tsconfig.json' })],
plugins: [nodeResolve({ preferBuiltins: true }), typescript({ tsconfig: './tsconfig.json', noEmitOnError: true })],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing noEmitOnError led to rollup building even if there were type errors

@andrewrlee andrewrlee force-pushed the alee/fix-rollup-issues branch from 74f6654 to 8b72585 Compare March 24, 2025 18:01
@@ -6,7 +6,8 @@
"outDir": "./dist",
"declarationDir": "./dist",
"resolveJsonModule": true,
"sourceMap": true
Copy link
Contributor Author

@andrewrlee andrewrlee Mar 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rollup was complaining about module needing to be set to Node16 :

(!) [plugin typescript] @rollup/plugin-typescript TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'.

This didn't make sense as we had a chain of extends going to @tsconfig/node22/tsconfig.json which sets it there.

This was preventing typechecking entirely

Looks like there's a bug where extending doesn't work for modules

@andrewrlee andrewrlee force-pushed the alee/fix-rollup-issues branch 9 times, most recently from 65cbb27 to aeb9b15 Compare March 25, 2025 08:47
@andrewrlee andrewrlee force-pushed the alee/fix-rollup-issues branch from aeb9b15 to 5fafa0d Compare March 25, 2025 10:05
@andrewrlee andrewrlee merged commit 80b9188 into main Mar 27, 2025
4 checks passed
@andrewrlee andrewrlee deleted the alee/fix-rollup-issues branch March 27, 2025 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants