I'd like to be able to specify different esbuild c...
# sst
I'd like to be able to specify different esbuild configuration per function. This is so we can apply a 3rd party esbuild plugin (Thundra) differently depending on the function. At present, the bundle.plugins property takes an import path. This means I need a different esbuild.js for each function. I'm wondering if there's a better way to pass an array of configured esbuild plugin objects to the bundle.plugin property
Hey @Ross Coundon, can you show me a quick example of what the
looks like for a function, and which option would be different for each function?
So the esbuild.js looks like this:
Copy code
const { ThundraEsbuildPlugin } = require('@thundra/esbuild-plugin');

module.exports = [
    traceableConfigs: ['src.main.handler.api.*[traceLineByLine=true]'],
The array of strings assigned to traceableConfigs would be different per function
@Frank if we rework our build system with that fake function idea we can probably support defining plugins inline right
@Ross Coundon one approach from Thundra side is that you set the name of the config file in the Thundra esbuild plugin. And Thundra esbuild plugin read the configurations from the config file and there are multiple config files at the root of each project/module with the same name
So Thundra esbuikd plugin can use different configurations for each project/module as each of them has its own config file with specific configs.
But the question is that Thundra esbuild plugin is triggered individually for each project/module by SST?
@Frank is the esbuild plugin called once per stack?
I think it's per function. @thdxr can you confirm? AFK at the moment.
Can confirm that it is called once per function.
yeah it's once per function, we can maybe pass in an arg to the file we call so you can dynamically return results
the arg could contain info about the function
@thdxr yeah let’s explore the placeholder function trick after the dashboard sprint