-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Add a bundle script to generate a zip file for theme distribution #1417
Conversation
Would it be better to output a zip file instead of a directory? |
Definitely, that would be ideal. The problem is that Node.js doesn’t support the full |
Having as few npm dependencies as possible was a goal expressed in #1149 in 2017. Maybe it's time to re-examine that decision. I'm in favour of adding new dependencies where useful. I'd quite like to add npm-run-all and nodemon myself. |
I updated this PR to output a zip file instead of a directory using archiver. I have tested the command on macOS, and it works without any side effects. Could you please test it on a windows machine, if you have any? I agree with you that we shouldn't be limited to a fixed number of dependencies if these turn out to be useful. I think that we could add some needed functionality, like SASS watcher, browser-sync and maybe wp-env, while keeping a reasonable number of dependencies. Feel free to open an issue if you want to discuss this issue further. |
* 'master' of https://github.com/Automattic/_s: (92 commits) Remove PHPCS Ignore Around $content-width (Automattic#1450) Use _S_VERSION constant when enqueuing customizer.js (Automattic#1445) Update composer and node dependencies (Automattic#1444) Add missing s in languages directory name (Automattic#1442) Exclude alignment classes from RTL conversion (Automattic#1435) Add new required header fields for style.css (Automattic#1432) Remove redundant font-size declarations (Automattic#1434) Refactor navigation.js to Javascript ES6 (Automattic#1423) Delete the custom bundle script in favor of an npm package (Automattic#1433) Fix small typo (Automattic#1428) Re-organize SASS structure (Automattic#1425) Add a SASS watcher command (Automattic#1427) Remove the skip link focus fix (Automattic#1424) Replace className.indexOf with classList.contains (Automattic#1422) Use CSS grid for gallery styles (Automattic#1246) Update README.md documentation (Automattic#1419) Add a bundle script to generate a zip file for theme distribution (Automattic#1417) Update npm dependencies (Automattic#1418) Float implies the use of the block layout (Automattic#960) Use the system font stack from WP admin (Automattic#1416) ...
Changes proposed in this Pull Request:
This PR adds a NodeJS script to generate a zip file for theme distribution, while excluding development and system files.
Testing instructions:
To test this PR run
npm run bundle
in command line. A zip file containing only the essential theme files should be created in the parent directory of the actual theme. Note that the name of the zip file name should be the same as the theme directory name.