akanix42 / vue-css-modules

MIT License
2 stars 1 forks source link

scoped module stylus, not being compiled #2

Open eybarta opened 5 years ago

eybarta commented 5 years ago

Hi,

I'm trying to use your plugin in order to use postcss plugins in my .vue stylus as mentioned here: https://forums.meteor.com/t/deploy-to-production-component-css-not-loaded/36512/5

my style tag looks like this: <style scoped module lang="stylus">

my package.json:

"cssModules": {
    "postcssPlugins": {
      "postcss-responsive-type": {}
    }
  }

what happens is the styles inside the tag don't get compiled at all, no errors.

any idea what I'm doing wrong?

thank you

akanix42 commented 5 years ago

Looks like my example there was wrong, sorry about that. I see a couple of things to change: First, following the instructions here, if you specify custom postcss plugins you'll need to make sure you included the CSS module plugins as well. Updated package.json:

{
  "cssModules": {
    "postcssPlugins": {
      "postcss-modules-values": {},
      "postcss-modules-local-by-default": {},
      "postcss-modules-extract-imports": {},
      "postcss-modules-scope": {},
      "postcss-responsive-type": {}
    }
  }
}

You may need to place postcss-responsive-type above the others, I'm not sure. They are loaded in the order in which they are listed. Second, I'm not sure if this causes an issue, but the scoped attribute should be left off of the style tag: <style module lang="stylus">.