Code bundle editor

The code bundle editor is built-in to the EdgeWorkers Management application. You can use this custom tool to edit your EdgeWorkers without having to set up an integrated development environment or use a command line interface.

This tool is useful as a quick editor so you can view, validate, and edit the files in your code bundles.

  1. Log in to Control Center.

  2. Go to > CDN > EdgeWorkers.

  3. Select the EdgeWorker ID you want to edit.

  4. Select an EdgeWorker version from the EdgeWorker details page to edit an existing EdgeWorker version.

  5. Select the Code Bundle tab.

    The files included in the EdgeWorker version appear in the Code bundle editor.

Code bundle editor


You can also use the code bundle editor to create an EdgeWorker version.

  1. Review these features to learn how the code bundle editor can help you validate and edit your EdgeWorkers.
1. View diffSelect two versions of an EdgeWorker ID to compare. Once you've selected the versions you can pick a file from each code bundle to compare in a side-by-side view.

If a draft version exists for the EdgeWorker ID you can load it in the diff tool. This lets you compare a draft and a saved version.
2. Navigate filesNavigate between your EdgeWorkers by selecting a folder in the file tree. Open the bundle.json and main.js files to view them in the Code editor. Use the right click menu options to create a new directory or a new file in any existing directory or the root of the EdgeWorkers code bundle. You can also use the right click menu options to rename, remove, or copy/paste the files in the file tree.
3. View and editView the contents of the file you selected in the file tree. Here you can also view semantic and syntax validation. To save any changes you've made you need to create a new EdgeWorker version. Do this by manually typing in a new EdgeWorker version number.
4. View errorsView any validation errors. You cannot save an EdgeWorkers code bundle as a new version if it contains validation errors.

You can save a code bundle that contains validations errors as a draft.
5. Save as draft Create a draft if you want to save your changes and continue editing the code bundle later. You can save a draft even if your code bundle contains validation errors.
6. Create new versionThe Create new version button remains inactive until you update the EdgeWorker version number and resolve any validation errors.