In dev mode, bypass 11ty and watch the css file ourself and reference…#108
In dev mode, bypass 11ty and watch the css file ourself and reference…#108theor wants to merge 2 commits intogoogle:mainfrom
Conversation
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
|
@googlebot I signed it! |
| content = content.replace("</head>", `<style>${after}</style></head>`); | ||
| // in watch/serve mode, reference the stylesheet. As we bypass 11ty rebuild, | ||
| // Browsersync will reload only the css file, which is really fast | ||
| if (isDev) { |
There was a problem hiding this comment.
I'm confused by this. Don't you want to do this at the start of this function and then short-circuit the minification?
There was a problem hiding this comment.
I still wrote the minified css back, but that could be short-circuited too yes .I'll do that
… the stylesheet. This skips the lengthy 11ty rebuild and allows browsersync to reload only the css. Still inline it in build mode.
ATM I use
isDevelopment(argv.contains("--serve") to toggle the feature, not sure if that's the right way to do it.remaining issue: a test expects a
styletag, when in dev mode it should now expect alinktag.Before:
After: