-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NPM archive related scripts include node_modules and vendor files in zip. #97
Comments
@peterwilsoncc any recommended resolution here? |
It looks like the following needs to be added to the composer config. The catch is that it isn't possible to included the vendor directory as we have a mix of dev and production dependencies. If the archive function is run while the dev dependencies are installed, the file will still be quite large. "archive": {
"exclude": [
"/.distignore",
"/.github",
"/.gitignore",
"/.wordpress-org",
"/.wp-env.json",
"/.wp-env.override.json",
"/CHANGELOG.md",
"/CODE_OF_CONDUCT.md",
"/composer.json",
"/composer.lock",
"/CONTRIBUTING.md",
"/CREDITS.md",
"/package-lock.json",
"/package.json",
"/phpcs.xml",
"/phpunit.xml.dist",
"/README.md",
"/webpack.config.js",
"/node_modules",
"/tests"
] |
The same error if installed as a Composer package (GitHub ZIP contains development files). We should use gitattributes/export-ignore as |
Oh no! This solves only the git index part of the problem. |
Describe the bug
When building an archive using the NPM
archive
andpostarchive
scripts, thenode_modules
andvendor
folders are included in the zip file.In local testing, this created a 69.6 MB zip file.
Steps to Reproduce
npm i; composer i; npm run build;
npm run archive
-- observe the node and vendor folders are included in the zipnpm run postarchive
cd safe-svg; ls
Screenshots, screen recording, code snippet
No response
Environment information
WordPress information
N/A
Code of Conduct
The text was updated successfully, but these errors were encountered: