-
Notifications
You must be signed in to change notification settings - Fork 87
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
Expose JSON data to other PostCSS plugins? #29
Comments
I though about it too, but postcss-modules is used before concat, but cssnano works after concat :(. So it will works only if we concat files by postcss-import. Anyway we should think about addition way. For example we use selectors rules to find isolation classes. Like we can use But I think we should give a two ways. |
We already have the additional way, the existing |
We need |
@michael-ciniawsky Actually, the plugin uses I'll be happy if you make a PR for this, because I have no time to make it. |
Yep, of course 😛 css-loader-core/lib/parser.js plugin( css, result ) {
return Promise.all( this.fetchAllImports( css ) )
.then( _ => this.linkImportedSymbols( css ) )
- .then( _ => this.extractExports ( css ) )
+ .then( _ => {
+ this.extractExports( css )
+ result.messages.push({ type: 'modules', modules: this.exportTokens })
+ })
} ? |
Looks awesome! |
👍 Would be awesome to access the mappings through result.messages! :) |
It might be good to use Result#messages to store the JSON map of classes and generated class names. That way the data can be easily accessed by other plugins.
The text was updated successfully, but these errors were encountered: