Skip to content

Commit

Permalink
Add viewScriptModule support
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed Feb 7, 2024
1 parent eeffb21 commit cc8ad31
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions packages/scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ This script automatically use the optimized config but sometimes you may want to
- `--webpack-src-dir` – Allows customization of the source code directory. Default is `src`.
- `--output-path` – Allows customization of the output directory. Default is `build`.

Experimental support for the block.json `viewModule` field is available via the
Experimental support for the block.json `viewScriptModule` field is available via the
`--experimental-modules` option. With this option enabled, script and module fields will all be
compiled. The `viewModule` field is analogous to the `viewScript` field, but will compile a module
compiled. The `viewScriptModule` field is analogous to the `viewScript` field, but will compile a module
and should be registered in WordPress using the Modules API.

#### Advanced information
Expand Down Expand Up @@ -396,9 +396,9 @@ This script automatically use the optimized config but sometimes you may want to
- `--webpack-src-dir` – Allows customization of the source code directory. Default is `src`.
- `--output-path` – Allows customization of the output directory. Default is `build`.

Experimental support for the block.json `viewModule` field is available via the
Experimental support for the block.json `viewScriptModule` field is available via the
`--experimental-modules` option. With this option enabled, script and module fields will all be
compiled. The `viewModule` field is analogous to the `viewScript` field, but will compile a module
compiled. The `viewScriptModule` field is analogous to the `viewScript` field, but will compile a module
and should be registered in WordPress using the Modules API.

#### Advanced information
Expand Down
2 changes: 1 addition & 1 deletion packages/scripts/utils/block-json.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const moduleFields = new Set( [ 'viewModule' ] );
const moduleFields = new Set( [ 'viewScriptModule', 'viewModule' ] );
const scriptFields = new Set( [ 'viewScript', 'script', 'editorScript' ] );

/**
Expand Down

0 comments on commit cc8ad31

Please sign in to comment.