So after reading the discussion here (Sage 9 main.css 404 on devUrl), I more or less understand the intent in not providing the built
dist when running
yarn start, and only generating that file on
yarn build. However, because we have a not-so-flexible deployment system (WP Engine), this has some less than ideal implications for us in our development process.
WP Engine, as far as I can tell yet, doesn’t offer a way for us to execute post-receive commands on the server, like rebuilding the theme. Consequently we have to track our
dist files in our git repo, because that’s the only way we can use
git push to deploy our code to WP Engine’s staging & production servers. It works great for us, only just means we have a little extra crap in our git repo, which we’ve been able to tolerate fine.
During development, we generally just keep our watch/browsersync session running in the background constantly, and commit our code fairly routinely, including deploying to staging from time to time to demonstrate functionality to coworkers or clients. With our other themes we’ve built (most use
gulp in combo with
browsersync), we’re used to expecting the
dist folder to be always up to date with the compiled CSS.
However, this is no longer the case with Sage 9. We have to run
yarn build every time we deploy to staging. And ideally, every individual commit’s
dist files would be in sync with that commit’s source files.
So I’d really prefer it if the
main.css file in
dist could be getting rebuilt in the background as browsersync is running; would just make things a lot less cumbersome for us.
As it works now, I’m looking into finding a way to automatically run
yarn build before each local commit; not overly familiar with git hooks but I imagine it’s possible.
Another thing to point out is that you’re probably going to keep getting people complaining about this intended behaviour of 404s in the console. Red error notifications in the Chrome console aren’t typically something that is easily overlooked by seasoned developers… or maybe that’s just me. I find it hard to remind myself to ignore any console error and accept it as normal.
Anyway, besides this one little issue, I love Sage 9 (as if I didn’t love Sage 8 enough) and can’t really say enough good about your design of this product.