-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Handling imports with multiple plugins #1233
Comments
Similar to #501? |
I was following the discussions on that issue. But, rebuilding the project again is not a clean and proper solution to this kind of problem. As a webpack user, I expected all of my plugins to be executed in the order of their placement in the build script one after another. I think there must be a better solution to achieve this without building the project again. @evanw If you think it can't be done with the current version of esbuild, I would love to participate and make a pull request. |
@hmak-me how far with this issue. stuck on the same problem |
My use case (not currently possible – right?):
I’m still in the process of thinking this fully through. Thus, it’s possible I made mistakes somewhere. Example – files
What an esbuild plugin would have to doThe plugin would have to forward
Benefits of this approach
Example repositoryhttps://github.com/rauschma/server-side-rendered-css |
There are cases that we need multiple plugins to handle some import statements. For example, an alias plugin that resolves the paths to the alias imports. The result of this plugin has to be visible to all other plugins that have a similar filter RegExp. The following build script describes the situation:
Build Script:
Description:
src
alias..gql
and.graphql
files.src
directory as external modules to prevent them from bundling. It also provides a relative path to the imported module calculated from the location of the importer module.Problem:
The
aliasImport
plugin does its job pretty well, but it will end just right there. The modules processed in this plugin, will not be visible for the next plugins. They won't be passed tographqlImport
andmakeExternal
plugins.I think there must be a way to let other plugins access the previously processed files.
The text was updated successfully, but these errors were encountered: