Replies: 1 comment
-
There's a hook system in trunk: https://trunkrs.dev/assets/#hooks Maybe that works for your case? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is a problem with my specific use case with trunk and compile time styling libraries, not specifically a bug.
What I am doing is using turf to compile Sass and output a single final CSS file with unique modular class names like CSS Modules. I then import this CSS file in trunk entrypoint index.html:
The problem is if I choose to watch this
generated/
directory for updates, if there is a compilation error, an infinite build cycle is created since this directory is updated with each build and this triggers the next build.If I choose to not
watch
it, trunk first copies the content ofgenerated/css/style.css
then it builds the project and triggers the Sass compilation again which in turn, generates new class names to be used for components. This causes the styles to not be applied since class names that components use now doesn't exist in thestyle.css
file (it contains last build's unique class names).I know for a fact that one solution would be to somehow force trunk to copy the CSS asset AFTER the build. But I don't know if it's possible at this point.
Any ideas on how I can tackle this problem?
Beta Was this translation helpful? Give feedback.
All reactions