-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add CSS generation on-the-fly #2050
base: main
Are you sure you want to change the base?
Conversation
…(moved to @imports in styles.css); minify CSS as last step
…iles when changes are made
…` of tailwind 3; add `gulp-clean-css` plugin for CSS minification
…removes POSTCSS as well, which will be handled natively by tailwind)
🧪 Review environmenthttps://cdtlcbagmr4jclwbqibuipckfa0yrltg.lambda-url.ca-central-1.on.aws/ |
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 tested this locally and if I run poetry run flask run -p 6012 --host=localhost
and npm run watch
in separate terminals it all works as expected! The css is regenerated and reloading the browser gets the new styles.
I did have to run npm run tailwind
first to generate the static assets, so I think we should change npm run build
to npm run tailwind
over here: https://github.com/cds-snc/notification-admin/blob/main/.devcontainer/scripts/installations.sh#L53
The debugger config also worked.
I am seeing an error at the end of the dev container set up script but that is not related to your PR.
@@ -53,7 +53,8 @@ coverage: venv ## Create coverage report | |||
|
|||
.PHONY: run-dev | |||
run-dev: | |||
poetry run flask run -p 6012 --host=localhost | |||
npm run watch & \ |
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.
This part isn't working for me - can we add this to a new make watch
command?
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.
Good idea, ill make those changes!
Could you expand on this? I tried deleting my I don't mind making this change, because its probably what should be in that script anyway ( |
@andrewleith okay I tried again and I think you are right. When building a new dev container, I was seeing |
Summary | Résumé
This PR updates our frontend build pipeline so that we can take better control of it. In particular, these changes enable us to implement better developer experience by allows us to generate our tailwind + css on the fly as we are developing in a few seconds, vs. waiting the 25s+ it was taking before to run
npm run tailwind
Improvements
npm run watch
) 🎉make run-dev
🎉Build pipeline before
Build pipeline after
Quick launch of notify for debugging
Rebind
F5
keyboard shortcut for admin onlycmd+shift+p
and type `Open keyboard shortucts (JSON)Now when you press F5 in admin it will do the task - other repos will be unaffected!