Import a JavaScript module
EdgeWorkers are compiled as ECMAScript 6 Modules, and provide access to static import. You can load relative JavaScript modules in the main.js file that contain the callbacks used to modify HTTP requests and responses.
📘 The JavaScript module name you import needs to include the
.jsextension.
If you use the import function you can load additional module files and directories in the EdgeWorkers code bundle. Use the following structure for the EdgeWorkers code bundle.