@aziontech/bundler 1.3.1 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -127,7 +127,7 @@ Options:
127
127
  -w, --worker [boolean] Indicates that the constructed code inserts its own worker expression (default: false)
128
128
  -d, --dev Build in development mode (default: false)
129
129
  -x, --experimental Enable experimental features (default: false)
130
- --skip-framework-build Skip framework build step (default: false)
130
+ --skip-framework-build Do not run the framework build; reuse the output of a previous one, e.g. dist (default: false)
131
131
  --config-version <version> Config (Azion API) version: 3, 4 or 6. Overrides the `version` field of azion.config (default: 4)
132
132
  --config-file <path> Path to the azion.config file to use (default: azion.config.* found in the current directory)
133
133
  --only-generate-config Build only generate azion.config (default: false)
@@ -175,12 +175,23 @@ Arguments:
175
175
  Options:
176
176
  -p, --port <port> Specify the port (default: "3333")
177
177
  -x, --experimental Enable experimental features (default: false)
178
- --skip-framework-build Skip framework build step (default: false)
178
+ --skip-framework-build Do not run the framework build; reuse the output of a previous one, e.g. dist (default: false)
179
179
  --function-name <name> Specify the function name
180
180
  --config-version <version> Config (Azion API) version: 3, 4 or 6. Overrides the `version` field of azion.config (default: 4)
181
181
  --config-file <path> Path to the azion.config file to use (default: azion.config.* found in the current directory)
182
+ --args-path <path> Path to the args JSON file bound to ctx.args (event.args) of the function (default: azion/args.json)
182
183
  ```
183
184
 
185
+ #### Function args
186
+
187
+ The local runtime gives the function the same args a deployed one receives: `ctx.args` in `fetch(request, env, ctx)` and `firewall(request, env, ctx)`, and `event.args` in `addEventListener`. They come from `azion/args.json`, or from the file given to `--args-path` (relative to the current directory).
188
+
189
+ ```bash
190
+ azbundler dev --args-path ./config/args.staging.json
191
+ ```
192
+
193
+ The file is read on every request, so editing it needs no restart. When the file does not exist the args are `{}`, as on a deploy of a project without args. When it is not a JSON object the args are `{}` too, and a warning is shown. A change to the args file does not rebuild the project.
194
+
184
195
  ### `config`
185
196
 
186
197
  Manages Azion configuration settings with CRUD operations.