The Builder uses the rollup JS API to compile and bundle your background functions.

Entrypoints

Each file in your defer folder should export a Defer background function as its default export.

Here are the requirements for those files:

  • .js, .jsx, .ts, .tsx, .cjs, .cjsx, .cts, .ctsx, .mjs, .mjsx, .mts, .mtsx extensions are supported
  • *.spec.*, *.test.*, *_spec.*, *_test.* files are ignored
  • spec, test, specs, tests nested folders are skipped

Typescript

Version 4.x and 5.x are supported.

The Builder detects your version of TS and uses it to compile your background functions.

TS errors will only result in warnings (as per the TS compiler default noEmitOnError)

Supported files

  • .json
  • .jsx
  • .md
  • .txt
  • .html
  • .jpg, .jpeg, .png, .svg, etc

Bundles and Sourcemaps

Here are the characteristics of the output of the Builder:

  • One bundle per function
  • Tree shaking is performed to reduce bundle size
  • Bundles are emitted under the commonJS format
  • Sourcemaps are generated