dherault / dherault/serverless-offline
Offline is not using neither the provided esbuild config file nor ts-node as expected
- Dominant language
- JavaScript
- Stars
- 5.3k
- Forks
- 811
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 3
Description
## Bug Report
Offline is not using neither the provided esbuild config file nor ts-node. The function works fine when deploying to aws with `sls deploy` or locally with `sls dev`. My project is based on NestJs, that means decorators et class metadata should be enabled in build configuration. When I run my code with `ts-node`, it works fine too. But the offline seems change the configuration and never add emission of metadata.
**Sample Code**
- file: serverless.yml
```yaml
service: my-service
plugins:
- serverless-offline
build:
esbuild:
configFile: ./bundlers/esbuild/esbuild.config.mjs
provider:
runtime: nodejs20.x
stage: dev
functions:
hello:
events:
- http:
method: get
path: hello
handler: handler.hello
```
> [!NOTE]
> 1. The esbuild configuration file extension is `mjs`
> 1. `serverless-offline` is the only used plugin
**Environment**
- `serverless` version: v4.4.7
- `serverless-offline` version: v14.3.3
- `node.js` version: v20
- `OS`: macOS 15.0.1
**Additional context/Screenshots**
1. The project is in typescript
1. No file is output after the build using `serverless-offline`
**Workaround**
- use `sls dev` instead of `sls offline`
Contributor guide
Assessment
This issue has not been assessed yet.