-
I have try to update my theme config like this
And then I don't know where I should put :
I did try in the layout component on my theme, but it seems not the right place as @meteorlxy told me here: #548 but I don't understand this sentence :
The second line says layout will be client file but the first one says all theme is node app. Edit: I found a way to make windi load by creating the file
But now it seems, my class are not apply, my windi config is :
Do I need to use |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
i was finally able to make it work with the deprecated flow of windi with postcss:
and
And
And
this is not optimal I hope to have better solution soon. |
Beta Was this translation helpful? Give feedback.
-
I'm not a native English speaker.
What I really mean is "The entry file of a plugin or the entry file of a theme". What's the suggestion about the description? 🤔 |
Beta Was this translation helpful? Give feedback.
-
I was struggling with this too, but I was able to get this to work with Webpack. I did this: npm i windicss-webpack-plugin Then in Vuepress config ( const WindiCSSWebpackPlugin = require('windicss-webpack-plugin')
module.exports = {
bundler: '@vuepress/bundler-webpack',
bundlerConfig: {
configureWebpack: () => {
return {
plugins: [new WindiCSSWebpackPlugin()]
}
}
}
} And finally in import 'windi.css' At least Webpack is better supported than PostCSS as per Windi CSS docs. |
Beta Was this translation helpful? Give feedback.
-
Took me only 5 hours of debugging 🤓, I found the problem: Windi was searching for files in and the solution: 😎 (stupidly simple)
import WindiCSS from 'vite-plugin-windicss'
module.exports = {
bundlerConfig: {
viteOptions: {
plugins: [
WindiCSS({
root: __dirname, // default is .temp/vite-root
scan: {
dirs: ['.'], // default is ['src']
},
}),
],
},
},
import 'virtual:windi.css'
import 'virtual:windi-devtools'
// needs dummy export
import { defineClientAppEnhance } from '@vuepress/client'
export default defineClientAppEnhance(({ app, router }) => {}) |
Beta Was this translation helpful? Give feedback.
Took me only 5 hours of debugging 🤓, I found the problem:
Windi was searching for files in
.vuepress/.temp/vite-root
which only hadindex.html
🤷and the solution: 😎 (stupidly simple)
page/.vuepress/config.ts
page/.vuepress/clientAppEnhance.ts