-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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]: Support for ESBuild plugins? #12754
Comments
I have found a workaround using patch-package... be warned it's limited! Create a directory called patches and then place the following patch file inside @nrwl+esbuild+15.3.3.patch. Then run Once the patch has applied successfully you can provide an "additionalOptions" property that points to an ES module file. "build": {
"executor": "@nrwl/esbuild:esbuild",
"options": {
"additionalOptions": "libs/mylib/esbuild.mjs",
...
}
}, Then export additional esbuild options :) // esbuild.mjs
import {sassPlugin} from 'esbuild-sass-plugin'
export default {
plugins: [
sassPlugin({
type: "lit-css",
})
]
}; Permanent fix? |
Is there any plans on implementing support for esbuild plugins? I want to switch from webpack to esbuild for the much better performance of it, but i realy need the plugin support for this. |
+1 for adding plugins to the esbuild config block in the project.json. |
@DerHerrGammler - I think there is talk about it coming in near future. |
raw esbuild is useless for Typescript when working with any of the major frameworks as they tend to depend on decorators, which the author of esbuild is not interesting in supporting evanw/esbuild#104 . At least with plugins, this allows for use of a plugin that uses tsc when it encounters a ts file. |
Based on #15021 and #16092, it looks like it should support plugins now? Or am I wrong? I can't find any documentation about how its done though. If anybody could provide code for how to add for example this plugin it would be greatly appreciated. |
Got this to work. // build.cjs - esbuild config
const esbuildPluginPino = require('esbuild-plugin-pino')
/** @type {import('esbuild').BuildOptions} */
module.exports = {
plugins: [esbuildPluginPino({ transports: ['pino-pretty'] })],
outdir: 'dist/packages/api'
} // project.json
{
"targets": {
"build": {
...
"options": {
"outputPath": "dist/packages/api",
"esbuildConfig": "{projectRoot}/build.cjs"
},
...
}
},
} The thing you have to watch out for is that outdir must be copied from the |
Can't use the sentryEsbuildPlugin. It doesn't upload any Sourcemaps.
And my project.json:
|
I found a way to make project.json
esbuild.config.js
This |
Hey everyone, since #16092 you can specify your own |
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. |
Description
Is there any intention to support ESBuild plugins for the ESBuild executor?
I'd love to configure it to build and serve my React application but found no way I could set up loaders for example for SASS files.
Alternatively, if there is a way to do this already I'd be happy for some pointers :)
Motivation
Building/serving more complex projects.
Suggested Implementation
Alternate Implementations
The text was updated successfully, but these errors were encountered: