Open theoephraim opened 2 weeks ago
Latest commit: 591950d0575df2a4abca9564fa93c0b9d7a08ffd
The changes in this PR will be included in the next version bump.
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 will probably find time to look at the test soon. However wondering to get @ascorbic review of the general approach of allowing node:
prefix. Should be safe, I guess :)
Yes, the approach is good, and is similar to the one I used for Remix. A good future addition could potentially be to automatically add the prefix for all node builtins when reolving the ID.
Addresses #285
Changes
Adds a simple esbuild plugin to allow
node:
prefixed imports in the netlify adapter's call to esbuild.Testing
Tests are currently not passing.
I started to play with it but it seems to do more with how the testing is set up and fixtures are loaded. I would have expected the middleware having node imports in it to not trip up at all, and only falter on the unprefixed node import, only when
edgeMiddleware: true
option is on.Happy to help collaborate to fix it, but someone with more knowledge of the testing setup will be much better able to solve this.
I have personally verified that adding this code fixes my issues when building and deploying to netlify, and does not seem to break anything else.
Docs
I think this change should match user's expectations moreso than the current behaviour.