Skip to main content

Interface: BundleOptions

worker.BundleOptions

Options for bundling Workflow code using Webpack

Properties​

failureConverterPath​

• Optional failureConverterPath: string

Path to a module with a failureConverter named export. failureConverter should be an instance of a class that implements FailureConverter.


ignoreModules​

• Optional ignoreModules: string[]

List of modules to be excluded from the Workflows bundle.

Use this option when your Workflow code references an import that cannot be used in isolation, e.g. a Node.js built-in module. Modules listed here MUST not be used at runtime.

NOTE: This is an advanced option that should be used with care.


logger​

• Optional logger: Logger

Optional logger for logging Webpack output


payloadConverterPath​

• Optional payloadConverterPath: string

Path to a module with a payloadConverter named export. payloadConverter should be an instance of a class that implements PayloadConverter.


plugins​

• Optional plugins: BundlerPlugin[]

List of plugins to register with the bundler.


preloadModules​

• Optional preloadModules: string[]

List of modules to load once during reusable V8 context bootstrap.

Preloaded modules are shared across workflows that execute in the same reusable V8 context. Module scope in these modules runs before a workflow activator exists, so this option is only appropriate for modules that are safe to initialize that early.

NOTE: This is an advanced option that should be used with care. Preloading modules that internally stores some form of per-workflow state will very likely cause workflow context leak, which may result in non-deterministic behavior and/or cause other unexpected behaviors.


webpackConfigHook​

• Optional webpackConfigHook: (config: Configuration) => Configuration

Before Workflow code is bundled with Webpack, webpackConfigHook is called with the Webpack configuration object so you can modify it.

Type declaration​

▸ (config): Configuration

Parameters​
NameType
configConfiguration
Returns​

Configuration


workflowInterceptorModules​

• Optional workflowInterceptorModules: string[]

List of modules to import Workflow interceptors from.

Modules should export an interceptors variable of type WorkflowInterceptorsFactory.


workflowsPath​

• workflowsPath: string

Path to look up workflows in, any function exported in this path will be registered as a Workflows when the bundle is loaded by a Worker.