Is there an existing issue for this?
Use case description
Project with 2 functions:
- Function already built externally (e.g. Nuxt uses Vite to produce code that's ready to go)
- Function to be built with esbuild
By default ESBuild bundles dependencies into a single file. Works great in most situations.
For functions that rely on pre-built code (e.g. Nuxt) the ESBuild processing results in failures like this:
✘ [ERROR] Could not resolve "tslib"
The only way I can get this to work is setting this global packages: external config:
build:
esbuild:
bundle: true
packages: external
Applying this to all functions is undesirable, because dependencies will no longer be bundled.
I would like a way to control this setting on a per-function basis.
Proposed solution (optional)
This per-function configuration:
functions:
nuxtSSREngine:
build:
esbuild:
packages: external
Only enable if packages built indiidually:
package:
individually: true
Is there an existing issue for this?
Use case description
Project with 2 functions:
By default ESBuild bundles dependencies into a single file. Works great in most situations.
For functions that rely on pre-built code (e.g. Nuxt) the ESBuild processing results in failures like this:
The only way I can get this to work is setting this global
packages: externalconfig:Applying this to all functions is undesirable, because dependencies will no longer be bundled.
I would like a way to control this setting on a per-function basis.
Proposed solution (optional)
This per-function configuration:
Only enable if packages built indiidually: