Azion Bundler is a powerful tool designed to build and adapt projects for edge computing. It handles module resolution and applies necessary polyfills through unjs/unenv while providing an abstraction layer over popular bundlers like esbuild and webpack. The tool includes a local development environment for testing and debugging, and processes Infrastructure as Code (IaC) through its manifest system.
For those who just want to use Azion Bundler in their project without contributing to the development, you can install it directly from npm.
npm install edge-functions
or if you prefer yarn:
yarn add edge-functions
Follow these steps to start using Azion Bundler:
-
Clone the repository: Clone the Azion Bundler repository from GitHub to your local machine.
git clone https://github.com/aziontech/bundler.git
-
Installation: Navigate to the cloned Azion Bundler directory and install the required dependencies.
cd bundler npm yarn install
-
Install the Azion Bundler CLI globally, which allows you to use it as a command-line tool from anywhere in your system.
npm install -g
This command sets up the necessary project structure and configuration files for Azion Bundler.
-
Start developing: Once the project is set up, you can start developing your JavaScript applications or frameworks using the power of Bundler.
See some examples below:
-
Build a JavaScript/Node project (back-end)
ef build
-
Build a TypeScript/Node (back-end)
ef build --preset typescript
-
Build a Next.js project
ef build --preset next
-
Build Astro.js project
ef build --preset astro
-
Test your project locally (after build)
ef dev
The Azion Bundler CLI provides several commands to help you manage your edge applications:
⚠️ *Deprecation Notice: Support for the webpack bundler will be discontinued in future releases. While it is still available for now, new features, fixes, and improvements will be focused exclusively on esbuild. We recommend migrating to esbuild as soon as possible to ensure compatibility and better performance in upcoming versions.
Builds your project for edge deployment.
ef build [options]
Options:
-e, --entry <string> Code entrypoint (default: ./handler.js or ./handler.ts)
-p, --preset <type> Preset of build target (e.g., vue, next, javascript)
--polyfills Use node polyfills in build (default: true)
-w, --worker Enable worker mode with addEventListener signature (default: false)
-d, --dev Build in development mode (default: false)
-x, --experimental Enable experimental features (default: false)
Starts a local development environment.
ef dev [entry] [options]
Arguments:
entry Specify the entry file (default: .edge/worker.dev.js)
Options:
-p, --port <port> Specify the port (default: "3333")
-x, --experimental Enable experimental features (default: false)