-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
@nrwl/esbuild doesn't support plugins
in esbuildOptions
#14823
Comments
I am not sure I understand, could you provide a repo highlighting your expectation? |
I'm not sure I understand what you aren't sure you understand. To use esbuild plugins as explained here https://esbuild.github.io/plugins/#using-plugins, you have to be able to initialize them within a js file. esbuild provides no means to load plugins by name, and provides no means to load plugins via the command line (which you aren't using so that's moot). There's no reproduction to give because there's no way to create a reproduction, citing the info just given. The gist is that the line I linked to does nothing, it has no purpose, because the user can never pass in anything via project.json that would be valid for esbuild to use there. So while the code purports to support user-provided plugins, it in fact does not, because Nx doesn't support anything but JSON in project.json. That line of code should probably be removed. |
We discussed this, and we can get plugins to work if we support a So you can define something like: // esbuild.config.ts
export default {
//...
plugins: [require('foo-plugin')]
} or // esbuild.config.js
module.exports = {
// ...
plugins: [require('foo-plugin')]
}; |
Being able to use a companion |
We'll get that feature in. There shouldn't be things that can be done with plain esbuild API that cannot be done through Nx. |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
The esbuild plugin purports to support
plugins
via this line:nx/packages/esbuild/src/executors/esbuild/esbuild.impl.ts
Line 101 in f38268b
But as esbuild itself requires the
plugins
property to contain an array of objects, this can never be used as the code was written, as there's no way to convey what esbuild wants viaproject.json
(and I'm not going to rant about why Nx doesn't support .js config files so don't worry, plenty of others already have)Expected Behavior
Some ability to use plugins.
GitHub Repo
No response
Steps to Reproduce
n/a
Nx Report
Failure Logs
Additional Information
n/a
The text was updated successfully, but these errors were encountered: