Skip to content

Commit

Permalink
Update webpack options for wp-scripts in README.md (#56314)
Browse files Browse the repository at this point in the history
* Update webpack options in README.md

* Add support for custom output directory in build
process
  • Loading branch information
juanmaguitar authored Nov 20, 2023
1 parent d7f8cff commit 59c0356
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ It might also be a good idea to get familiar with the [JavaScript Build Setup tu

## Automatic block.json detection and the source code directory

When using the `start` or `build` commands, the source code directory ( the default is `./src`) and its subdirectories are scanned for the existence of `block.json` files. If one or more are found, they are treated a entry points and will be output into corresponding folders in the `build` directory. This allows for the creation of multiple blocks that use a single build process. The source directory can be customized using the `--webpack-src-dir` flag.
When using the `start` or `build` commands, the source code directory ( the default is `./src`) and its subdirectories are scanned for the existence of `block.json` files. If one or more are found, they are treated a entry points and will be output into corresponding folders in the `build` directory. This allows for the creation of multiple blocks that use a single build process. The source directory can be customized using the `--webpack-src-dir` flag and the output directory with the `--output-path` flag.

## Updating to New Release

Expand Down Expand Up @@ -106,6 +106,7 @@ This script automatically use the optimized config but sometimes you may want to
- `--webpack-copy-php` – enables copying all PHP files from the source directory ( default is `src` ) and its subfolders to the output directory.
- `--webpack-no-externals` – disables scripts' assets generation, and omits the list of default externals.
- `--webpack-src-dir` – Allows customization of the source code directory. Default is `src`.
- `--output-path` – Allows customization of the output directory. Default is `build`.

#### Advanced information

Expand Down Expand Up @@ -388,6 +389,7 @@ This script automatically use the optimized config but sometimes you may want to
- `--webpack-devtool` – controls how source maps are generated. See options at https://webpack.js.org/configuration/devtool/#devtool.
- `--webpack-no-externals` – disables scripts' assets generation, and omits the list of default externals.
- `--webpack-src-dir` – Allows customization of the source code directory. Default is `src`.
- `--output-path` – Allows customization of the output directory. Default is `build`.

#### Advanced information

Expand Down

0 comments on commit 59c0356

Please sign in to comment.