Closed cezaraugusto closed 4 weeks ago
Hi~ @cezaraugusto, I have verified these distribution package-related flags and confirmed that they are all working as expected. However, when using the --zip-source
flag, have you considered excluding the node_modules
directory from the zip file ❓
@OSpoon you're right! Now it only adds files not specified by .gitignore
. I updated the output as well
Hi~ @cezaraugusto, I think some further improvement is needed. The current zip file is missing the directory structure of the source.
LGTM++
Thank you very much for inviting me to review your code. I believe this PR can be merged, and I also find the addition of these flags very useful. 😁
Thanks @OSpoon!
When users run
npx extension build <path>
, add a few flags related to the distribution package:--zip [boolean]
: whether or not to compress the extension into a ZIP file. Defaults tofalse
--zip-source [boolean]
: whether or not to include the source files in the ZIP file. Defaults tofalse
--zip-filename <string>
: specify the name of the ZIP file. Defaults to the extension name and version, likemy-ext-name-1.0.0.zip
.How to test
yarn extension build <extension-path> --zip
should generate a zip file from distribution files to(projectPath)/dist/<browser>/<zip-name>.zip
yarn extension build <extension-path> --zip-source
should generate a zip file from source files to(projectPath)/dist/<browser>/<zip-name>-source.zip
yarn extension build <extension-path> --zip --zip-filename=my-custom-name
should generate a zip file from distribution files (with custom name) to(projectPath)/dist/<browser>/<custom-zip-name>.zip
.