I am building my own theme using the Sage WordPress theme template. I can build the development version of my theme, but I am unsure how to compress it into a usable .zip
file for production.
I have tried 2018 ver solution but didn’t work; it made broken zip file.
Error: Composer could not detect the root package (roots/sage) version, defaulting to '1.0.0'. See https://getcomposer.org/root-version
Entire output:
Preparing my-theme...
Composer could not detect the root package (roots/sage) version, defaulting to '1.0.0'. See https://getcomposer.org/root-version
Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Package operations: 0 installs, 0 updates, 1 removal
- Removing laravel/pint (v1.16.0)
Generating optimized autoload files
46 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Not a git repository. Skipping commit hash generation.
Composer could not detect the root package (roots/sage) version, defaulting to '1.0.0'. See https://getcomposer.org/root-version
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Package operations: 1 install, 0 updates, 0 removals
- Installing laravel/pint (v1.16.0): Extracting archive
Generating optimized autoload files
46 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Finished!
my-theme $
I tried using a theme download plugin, and it works, but the resulting zip file was around 70MB because it included the node_modules
folder.
I know there is a build command in package.json
which creates a /public
directory, but my question is: What exactly do I need to compress into a zip file for it to be a usable theme?
Here’s what my project directory looks like: