Skip to content

Commit

Permalink
Fix build script --report option (#15323)
Browse files Browse the repository at this point in the history
Co-authored-by: fisker Cheung <lionkay@gmail.com>
  • Loading branch information
sosukesuzuki and fisker committed Aug 29, 2023
1 parent 941c6b3 commit a73cfa0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 0 additions & 2 deletions scripts/build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ yarn build --report=all
yarn build --report=stdout --report=text --report=html
```

**`--report` equals to `--report=html`**

### `--minify` and `--no-minify`

By default, the file minification is controlled by `config.mjs` and `bundler.mjs`, these flags are added to override that behavior.
Expand Down
8 changes: 4 additions & 4 deletions scripts/build/parse-arguments.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function parseArguments() {
minify: values.minify ? true : values["no-minify"] ? false : undefined,
clean: values.clean,
saveAs: values["save-as"],
report: values.report,
reports: values.report,
};

if (result.saveAs) {
Expand Down Expand Up @@ -59,14 +59,14 @@ function parseArguments() {
}
}

if (Array.isArray(result.report) && result.report.includes("all")) {
if (result.report.length !== 1) {
if (Array.isArray(result.reports) && result.reports.includes("all")) {
if (result.reports.length !== 1) {
throw new Error(
"'--report=all' can not use with another '--report' flag",
);
}

result.report = ["html", "text", "stdin"];
result.reports = ["html", "text", "stdout"];
}

return result;
Expand Down

0 comments on commit a73cfa0

Please sign in to comment.