From bed1eec19128cb18032c981f8a0c2da520a6ddb2 Mon Sep 17 00:00:00 2001 From: Tim Rogers Date: Mon, 26 Aug 2024 08:17:36 +0100 Subject: [PATCH] fix(docs): document the `--zip` flag in the `plasmo build` CLI (#1051) Document the `--zip` flag in the `plasmo build` CLI The `plasmo build` CLI supports a `--zip` flag which builds your extension and then packages it into a ZIP file. This is mentioned in the Plasmo docs, but not in the in-CLI help, which I found confusing. This adds it to the help output, in the process splitting the documentation for the `dev` and `build` commands. --- cli/plasmo/src/features/helpers/flag.ts | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/cli/plasmo/src/features/helpers/flag.ts b/cli/plasmo/src/features/helpers/flag.ts index fdd715153..ea06a2ca0 100644 --- a/cli/plasmo/src/features/helpers/flag.ts +++ b/cli/plasmo/src/features/helpers/flag.ts @@ -35,6 +35,13 @@ export const getFlagMap = () => { } } +const DEV_BUILD_COMMON_ARGS = ` --target [string] set the target (default: chrome-mv3) + --tag [string] set the build tag (default: dev or prod depending on NODE_ENV) + --src-path [path] set the source path relative to project root (default: src) + --build-path [path] set the build path relative to project root (default: build) + --entry entry point name (default: popup) + --env relative path to top-level env file` + export const flagHelp = ` init @@ -42,12 +49,12 @@ export const flagHelp = ` --entry entry files (default: popup) --with- use an example template - dev/build + dev - --target [string] set the target (default: chrome-mv3) - --tag [string] set the build tag (default: dev or prod depending on NODE_ENV) - --src-path [path] set the source path relative to project root (default: src) - --build-path [path] set the build path relative to project root (default: build) - --entry entry point name (default: popup) - --env relative path to top-level env file +${DEV_BUILD_COMMON_ARGS} + + build + +${DEV_BUILD_COMMON_ARGS} + --zip zip the build output `