akanix42 / meteor-css-modules

MIT License
92 stars 20 forks source link

Error using sass and autoprefixer #46

Closed cristiancedenogallego closed 8 years ago

cristiancedenogallego commented 8 years ago

when add autoprefix or another postcss plugin modules not working return undefined on import

index.js

import styles from 'styles.scss';

console.log(styles); // return {}

styles.scss

.any {
   .b {
    display: block
   }
}

In package.json

"cssModules": {
    "ignorePaths": [
      "node_modules"
    ],
    "postcssPlugins": {
      "autoprefixer": {}
    },
    "extensions": [
      "scss",
      "sass"
    ]
  }
cristiancedenogallego commented 8 years ago

I fixed this problem setting postcss Plugins to:

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

I think documentation is not clearly specifying that modules by default are included but is necessary add this to postcssPlugins