-
Notifications
You must be signed in to change notification settings - Fork 156
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
fix(windicss): support transforming dist files #327
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/nuxtlabs/docus/8jZi4s6RQPoXbszmcNmfZiSnhvkN |
// Merge user and theme Windi configs | ||
windiOptions.config = defu.arrayFn(windiOptions.config || {}, localWindiConfig || {}, defaultWindiConfig) | ||
|
||
// Include local & npm depencies directories in scan process | ||
windiOptions.scanOptions.dirs.push( |
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 only works before the options have been resolved, this hook is run after the options are resolved though
so the include
below should be good enough
join(options.rootDir, '/node_modules/docus/dist'), | ||
join(options.themeDir) | ||
const transformFiles = await fg( | ||
'**/*.{vue,css}', |
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.
if you have any other style file type in the future with @apply's it will need to be added here
|
||
const glob = '/**/*.{html,vue,md,mdx,pug,jsx,tsx,svelte,css}' |
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.
just cleaned this up a little and added css so that the scan will find them
Hey @harlan-zw ; thanks for that! 🙏 |
Supports the @apply in dist css and vue files to be transformed.
Types of changes
Description
The Windi CSS package won't parse any files that are within an exclude glob. To get around this we added a special config
extraTransformTargets
that contains file paths that should be transformed.For it to work we need to add all files that need to be transformed within that config, which is what this PR is doing.
Have tested this with the
@nuxt/img
package and all seems to be working correctly without any extra configuration.