Skip to content
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

feat(builder): transform node: imports as needed #6356

Merged
merged 5 commits into from
Aug 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .yarn/versions/c8b9b062.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
releases:
"@yarnpkg/builder": minor
jkowalleck marked this conversation as resolved.
Show resolved Hide resolved

declined:
- "@yarnpkg/plugin-constraints"
- "@yarnpkg/plugin-exec"
- "@yarnpkg/plugin-interactive-tools"
- "@yarnpkg/plugin-stage"
- "@yarnpkg/plugin-typescript"
- "@yarnpkg/plugin-version"
- "@yarnpkg/plugin-workspace-tools"
- "@yarnpkg/cli"
9 changes: 9 additions & 0 deletions packages/yarnpkg-builder/sources/commands/build/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,15 @@ export default class BuildPluginCommand extends Command {
minify: !this.noMinify,
sourcemap: this.sourceMap ? `inline` : false,
target: `node${semver.minVersion(pkg.engines.node)!.version}`,
supported: {
/*
Yarn plugin-runtime did not support builtin modules prefixed with "node:".
See https://github.com/yarnpkg/berry/pull/5997
As a solution, and for backwards compatibility, esbuild should strip these prefixes.
*/
'node-colon-prefix-import': false,
'node-colon-prefix-require': false,
jkowalleck marked this conversation as resolved.
Show resolved Hide resolved
},
});

for (const warning of res.warnings) {
Expand Down