-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
fix: prefix node builtins for bundled files #12698
Conversation
🦋 Changeset detectedLatest commit: e67b38a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
I feel like we ought to be able to do this with the |
Yeah I've tried resolveId but that didn't work for the transitive imports. I wasn't sure if there was another way. Thinking about it we should probably close this since it's so risky with the current regex |
This reverts commit c020be0.
I've updated the regex to match on import declarations (from '...') to be less brittle (but brittle nevertheless). |
Hmm. I don't know. Personally I'm not a fan of complicating our build process in this way. I think it's better to ensure that |
I think I'll close this. It's unlikely we'll be adding new dependencies and it might be better practice to update the deps with the non-node prefixes. https://github.com/lukeed/totalist/blob/4b071d3e54d466a4059de89006c752da782c8b02/src/sync.js#L1-L2 |
Adds a rollup plugin to prefix all builtin node imports (including transitive dependencies). ChatGPT helped with this one so I'm sure it can be improved. Additionally, for some reason, it makes the build faster by a few ms (I thought an additional plugin would make it slower).
This solves the issue of current and potentially future transitive imports from not having the node: prefix.
Before:
After:
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. Changesets that add features should beminor
and those that fix bugs should bepatch
. Please prefix changeset messages withfeat:
,fix:
, orchore:
.Edits