Skip to content

Implement ModuleScopePluign for esbuild builds.#1094

Merged
LukeSheard merged 2 commits intomainfrom
feature/module-scope-plugin
Nov 24, 2021
Merged

Implement ModuleScopePluign for esbuild builds.#1094
LukeSheard merged 2 commits intomainfrom
feature/module-scope-plugin

Conversation

@LukeSheard
Copy link
Contributor

@LukeSheard LukeSheard commented Nov 24, 2021

Implement the equivalent of the ModuleScopePlugin which exists for webpack builds but for esbuild code paths. Resolves any relative imports from their current location to ensure that code is contained within the src directory.

See packages/modular-scripts/react-dev-utils/ModuleScopePlugin.js for the original implementation

@changeset-bot
Copy link

changeset-bot bot commented Nov 24, 2021

🦋 Changeset detected

Latest commit: 2da62df

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
modular-scripts Minor

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

@coveralls
Copy link
Collaborator

Coverage Status

Coverage increased (+0.8%) to 28.9% when pulling 2da62df on feature/module-scope-plugin into 9e1fbaf on main.

svgrPlugin(),
incrementalReporterPlugin(),
];
const plugins: esbuild.Plugin[] = [incrementalReporterPlugin()];
Copy link
Contributor

Choose a reason for hiding this comment

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

why are we removing the svgrPlugin here?

Copy link
Contributor Author

@LukeSheard LukeSheard Nov 24, 2021

Choose a reason for hiding this comment

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

Common plugins are setup in createEsbuildConfig.ts now so that we can minimalize differences.

@LukeSheard LukeSheard merged commit 7ae50b3 into main Nov 24, 2021
@LukeSheard LukeSheard deleted the feature/module-scope-plugin branch November 24, 2021 14:11
@github-actions github-actions bot mentioned this pull request Nov 24, 2021
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.

3 participants