I want to use the esbuild plugin <esbuild-plugin-t...
# help
p
I want to use the esbuild plugin esbuild-plugin-tsc in my SST app. Given that I have never worked with esbuld directly, I don't know how to customise the esbuild. Could someone help me on how to add esbuild plugin to SST. More info: Reason for adding esbuild-plugin-tsc plugin: I am using
type-graqhql
to build the graphql schema which needs emitDecorator feature, which is not supported by esbuild and the above plugin will use
tsc
to compile typescript file which contains decorators.
s
I believe you can modify the esbuild configuration as suggested in the docs; https://docs.serverless-stack.com/constructs/Function#configure-esbuild-plugins
f
Thanks @Sean Matheson 🎯
@Pavan Kumar lemme know if that works for u
p
@Frank It didn't work for my use case, I don't know whether it is to do something with the esbuild plugin or my configuration. For now here is how I am doing. In monorepo, I keep all the files with decorators in the package
commons
which will be transpiled by
tsc
and sst app will import the transpiled js file.
f
I see. Yeah.. the plugin really should work.. did you get an error?
If you get a chance to share a snippet, I can take a look and see if I spot anything weird 🙂
p
Sure, let me try to create snippet.