-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Support for declaring out field of OnResolveResult in plugin? #3133
Comments
This proposed API doesn't make sense for multiple reasons. One reason is that If you want to set the output path of an entry point, you can do that when you specify the entry point: https://esbuild.github.io/api/#entry-points. Alternatively if you're asking to set the output path of other files (including intermediate code splitting chunks), that is already tracked by #553. In any case I'm closing this issue because I do not plan to make the proposed API change. |
In this case, there must be explicit entryPoints. Due to the changing dependencies of some files based on their content, it is necessary to analyze the files and obtain clear entryPoints before each // app.js
export function App() {
return <div>app</div>
} entryPoints is When the content of the file changes: // app.js
import Foo from './foo.component.js';
export function App() {
return <div>app</div>
} must reset entryPoints to I said earlier that implementing the out field in onResolveResult or onLoadResult may not be a good solution. So what better way to support such a demand? @evanw thank you. |
If you want to change the entry points, then you can change them and restart esbuild's watch mode on a new esbuild context. This cannot be done from within a plugin because each plugin is specific to a single esbuild context. |
The file is analyzed in the plugin at build runtime, and I want to specify the output path of the file, like
This is very helpful for me to port the webpack build program, which added dependencies at runtime through the
SingleEntryPlugin
in the previous webpack build program.The text was updated successfully, but these errors were encountered: