Skip to content

Commit

Permalink
Add notes to esbuild docs
Browse files Browse the repository at this point in the history
  • Loading branch information
hansott committed Nov 21, 2024
1 parent 947b541 commit 40261b7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/esbuild.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Note: Zen runs only on the server side, it does not run in the browser.

Note: If `bundle` is set to `false` in the esbuild configuration, Zen will work without any additional configuration.

Zen works by intercepting `require()` calls that a Node.js application makes when loading modules. This includes modules that are built-in to Node.js, like the `fs` module for accessing the filesystem, as well as modules installed from the NPM registry, like the `pg` database module.

Bundlers crawl all of the `require()` calls that an application makes to files on disk. It replaces the `require()` calls with custom code and combines all the resulting JavaScript into one "bundled" file. When a built-in module is loaded, such as `require('fs')`, that call can then remain the same in the resulting bundle.
Expand All @@ -27,3 +29,5 @@ build({
```

This tells esbuild to exclude @aikidosec/firewall and any packages that Zen hooks into from the bundle.

⚠️ Don't forget to copy the node_modules directory to the output directory.

0 comments on commit 40261b7

Please sign in to comment.