-
Notifications
You must be signed in to change notification settings - Fork 6
[CHEC-667] - Bugfix/purge unused styles #233
Conversation
CHEC-667 Tailwind is not purging unused styles because no template paths have been provided
On both ui-library and dashboard. |
Hmmmn. Unfortunately that breaks the deploy preview storybook. So maybe we need to set the purge paths differently when building the storybook? This has gotten a little challenging. |
hmmmmm is right, will continue to investigate! |
Okay I'm not sure how we can do this. We don't want to include stories in our configuration when building the bundle ( |
tailwind.config.js
Outdated
@@ -16,6 +16,16 @@ const fontSizes = { | |||
'5xl': '2.5rem', | |||
}; | |||
module.exports = { | |||
purge: { | |||
enabled: process.env.NODE_ENV === 'production', |
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 think Vue CLI takes care of enabling this for you in production already, so I don't think you need this line.
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.
(Might be wrong)
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.
yes you're right i did come across this, it does by default. after some digging, think the issue is that the tailwind extractor does not include mdx ext.
will try your above suggestion with seeing which command is running
Just disabling the purgecss for storybook building is probably an acceptable workaround too. |
wait so looks like PurgeCss was added as a built-in in v1.4 which should then allow for the purge option in the configuration. https://github.com/tailwindcss/tailwindcss/releases |
Oh right. That's probably worth doing. We've already updated dashboard a while back. |
39701fb
to
c1c7cd1
Compare
…for building of lib bundle only
oh shucks its still purging storybook... |
My bad - that should probably fix it. |
Co-authored-by: Guy Marriott <[email protected]>
all good now thanks for you help on this! |
you're going to laugh to know i spent a good portion of last night adding those whitelist elements... lol |
Closes #145