Open toddheslin opened 7 years ago
I wanted to get rid of WP default themes too! So, I updated support/app_slug_compile.sh
, now it looks like this:
# ...
# Remove files to slim down slug if we're on Heroku
if [ ! -e .sluglocal ]
then
rm -rf vendor/WordPress
rm -rf public.built/wp-content/themes/twenty* # <- added this
rm -rf public
fi
# ...
Also, regarding your huge theme folder, you can ignore files/folders added to the slug by adding them in .slugignore
file. Mine looks like this for example:
# Ignored Theme's Assets and Folders
**/node_modules/
**/package.json
**/.jshintrc
**/.jshintignore
**/gulpfile.js
**/ruleset.xml
**/.gitignore
**/bowerrc
**/.editorconfig
Hope this helps!
Thanks @Tailzip I totally forgot to look at the if block below! Seems like the most logical way to do it.
I was under the impression that the .slugignore
is specific to Heroku and not the local Vagrant setup. Maybe @xyu can clarify and make a decision on the right way to ignore these. I think your solution is better, unless the reloader daemon starts copying files to Vagrant before the remove takes place, causing more issues.
Not sure what is going on under the hood for this sync function.
Yeah right now the rebuild script is pretty hacky, it should probably actually read .slugignore
when building the public html dir seeing as that would make it more like production.
I've noticed the the slug can sometimes take a huge time to compile if the theme is using NPM modules. I'm personally using FoundationPress on my site and the NPM modules folder (including dev dependencies) is over 200MB.
I also don't want all of the wordpress themes included in the composer install (back to twentyeleven!)
Therefore in
support/app_slug_compile.sh
I have changed:to
Haven't noted any bugs here, and not sure if the
rsync
can be optimised. However just leaving this as an enhancement for peoples to try out.Thanks for this awesome repo @xyu