Azion Bundler.config.js file
The bundler.config.js
file serves as a powerful configuration system for Azion Bundler, offering customization options for your application’s build process. While not mandatory, this file acts as an override mechanism, allowing you to define properties that supersede preset configurations.
Properties
Property | Type | Description | Additional Information |
---|---|---|---|
Entry | String | Represents the primary entry point for your application, where the building process begins | Entry will be ignored for Jamstack solutions |
Builder | String | Defines the build tool to use | Options:'esbuild' 'webpack' |
Custom | Object | Allows extending the capabilities of the chosen bundler (webpack or esbuild ) with custom plugins or configurations | Properties: Plugins (Object): Add custom plugins for the chosen bundler here. All properties related to the chosen bundler |
UseNodePolyfills | Boolean | Determines whether Node.js polyfills should be applied | Useful for projects leveraging Node.js functionalities targeting environments without built-in capabilities |
UseOwnWorker | Boolean | Indicates that the constructed code inserts its own worker expression, eliminating the need to inject a provider | Example: Hono framework |
Preset | Object | Provides preset-specific configurations | Properties: Name (String): refers to the preset name (example: "vue" or "next" ). Mode (String): specifies the mode for the preset (example: "compute" or "deliver" ) |
MemoryFS | Object | Configurations related to the in-memory filesystem | Properties: InjectionDirs (Array of Strings): directories injected into memory for runtime access via the fs API. RemovePathPrefix (String): prefix path to be removed from files before injecting into memory |
Custom | Object | Allows extending the capabilities of the chosen bundler (webpack or esbuild ) with custom plugins or configurations | Properties: Plugins (Object): add custom plugins for the chosen bundler here. All properties related to the chosen bundler can be used |
Azion Bundler employs the terminology compute
and deliver
to describe the operational modes of applications:
Mode | Description |
---|---|
Compute | Designed for applications that require computational processing at the edge, whether it’s for Front-End Server-Side Rendering (SSR) or Back-End tasks. In Compute Mode, Azion enables the execution of code and processing of dynamic content at the edge to enhance performance and responsiveness. |
Deliver | Tailored for frameworks that primarily focus on handling and routing incoming requests at the edge, with an emphasis on efficiently serving static files. While applications in Deliver Mode don’t execute dynamic code, they excel in optimizing the delivery of static content to end-users, thereby ensuring smooth and fast content distribution. |
Configuration
For a Next-based project:
Go to an implementation of the bundler.config.js file
Compatibility
Learn more about compatibility on the Azion Edge Platform.
Go to supported Web Frameworks Go to supported Web APIs Go to node.js support reference