css-modules / css-modules-loader-core

A loader-agnostic CSS Modules implementation, based on PostCSS
91 stars 34 forks source link

warnings #23

Open mightyaleksey opened 9 years ago

mightyaleksey commented 9 years ago

I found out that it is possible to add warnings with warn() method in the result class. Seems to me, some plugins use it to throw an error.

What you think about adding some functionality to handle those warnings and treat them as simple errors? I think we can simply throw an error somewhere here: https://github.com/css-modules/css-modules-loader-core/blob/master/src/index.js#L19

Currently, you don't see any if they occur.

mightyaleksey commented 9 years ago

As a possible solution, we can add a debug mode, so it will be possible to output those warnings. https://github.com/postcss/postcss/blob/master/docs/api.md#lazywarnings

Any thoughts?

mightyaleksey commented 9 years ago

There is also a quick solution as another postcss plugin: https://github.com/postcss/postcss-reporter