-
Notifications
You must be signed in to change notification settings - Fork 283
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
In dev mode, bypass 11ty and watch the css file ourself and reference… #108
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
style
tag, when in dev mode it should now expect alink
tag.Before:
After: