Skip to content
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

Pug not detected per default with Nuxt3 #266

Open
jbmolle opened this issue Dec 17, 2021 · 1 comment
Open

Pug not detected per default with Nuxt3 #266

jbmolle opened this issue Dec 17, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@jbmolle
Copy link

jbmolle commented Dec 17, 2021

Describe the bug
Check windicss/nuxt-windicss#144
When using pug class syntax in Nuxt3 with nuxt-windicss, WindiCSS doesn't not add the CSS classes.
For example
the following p(class="text-red-600") My Text works fine and displays a red text
But the following p.text-red-600 My Text does not.

Versions

  • nuxt-windicss: 2.1.1
  • nuxt3: latest
  • vite-plugin-windicss: 1.5.4
  • vite: 2.7.3

Additonal Context
The problem comes from getDefaultExtractors in vite-plugin-windicss/packages/plugin-utils/src/extractors/helper.ts
Nuxt uses dist/index.mjs from @windicss/plugin-utils and require('pug') line 17 fails (it calls __require which doesn't work). So the Pug extractor is not added. One solution currently is to add the extractor manually in the WindiCSS config.

@jbmolle jbmolle added the bug Something isn't working label Dec 17, 2021
@xxSkyy
Copy link

xxSkyy commented Jan 22, 2022

After time I think it this bug could be a feature, not supporting .class will keep code consistency as for example colons are not permitted in this syntax, keeping all classes in class attribute keeps it more clean as classes won't be divided at one with special character and without.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants