-
-
Notifications
You must be signed in to change notification settings - Fork 604
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
Produce JSON file(s) with class mappings #988
Comments
Can you provide case? |
EG in a rails template, I'd like to be able do to:
The |
Maybe we can implement |
That would work perfectly |
PR welcome, it is very rare feature, so it is not high priority |
It's surprising this feature doesn't exist already. Seems simple enough to just dump all the mappings in a JSON file. After looking into Another use case: |
@jcmcneal Consider your tone. The maintainers have already said 'PR welcome', so "It's surprising this feature doesn't exist already" sounds a little entitled. |
This package is used in 2.4M public repos and when I searched to find out how to get the mappings it did surprise me that there isn't a way yet. However, I'm glad you requested the feature and I only commented to show support that it's wanted by more than just one person. |
Yeah, I figured you didn't mean it that way - just pointing out that it's worth making it clear, especially when dealing with people who don't know you. |
This changeset adds a `getJSON` option to output CSS modules mappings to JSON. This value can be a boolean or a function, and it employs similar logic to [postcss-modules#getJSON](https://github.com/madyankin/postcss-modules?tab=readme-ov-file#saving-exported-classes) as a function. This is particularly useful for SSR/SSG/templating languages when CSS modules mappings need to be present at build time. Addresses [webpack-contrib#988](webpack-contrib#988).
This changeset adds a `getJSON` option to output CSS modules mappings to JSON. This value can be a boolean or a function, and it employs similar logic to [postcss-modules#getJSON](https://github.com/madyankin/postcss-modules?tab=readme-ov-file#saving-exported-classes) as a function. This is particularly useful for SSR/SSG/templating languages when CSS modules mappings need to be present at build time. Addresses [webpack-contrib#988](webpack-contrib#988).
This changeset adds a `getJSON` option to output CSS modules mappings to JSON. This value can be a boolean or a function, and it employs similar logic to [postcss-modules#getJSON](https://github.com/madyankin/postcss-modules?tab=readme-ov-file#saving-exported-classes) as a function. This is particularly useful for SSR/SSG/templating languages when CSS modules mappings need to be present at build time. Addresses [webpack-contrib#988](webpack-contrib#988).
Hey, everyone! I know I'm super late to the party, but I need this functionality for a project I'm working on so I've opened up a pull request here: #1577. Feel free to take a look--happy to update and correct issues as needed. Thanks in advance! (Also, it's my first time working in this repository so please let me know if I missed something in the contribution guidelines!) |
This changeset adds a `getJSON` option to output CSS modules mappings to JSON. This value can be a boolean or a function, and it employs similar logic to [postcss-modules#getJSON](https://github.com/madyankin/postcss-modules?tab=readme-ov-file#saving-exported-classes) as a function. This is particularly useful for SSR/SSG/templating languages when CSS modules mappings need to be present at build time. Addresses [webpack-contrib#988](webpack-contrib#988).
This changeset adds a `getJSON` option to output CSS modules mappings to JSON. This value can be a boolean or a function, and it employs similar logic to [postcss-modules#getJSON](https://github.com/madyankin/postcss-modules?tab=readme-ov-file#saving-exported-classes) as a function. This is particularly useful for SSR/SSG/templating languages when CSS modules mappings need to be present at build time. Addresses [webpack-contrib#988](webpack-contrib#988).
Fixed by #1577 |
Previously discussed in #143 , but that solution has not worked for a long time.
Feature Proposal
When compiling CSS modules, export a JSON file containing the mappings, so that the generated classnames can be used by e.g. SSR setups, and even from other languages.
Feature Use Case
I really like using CSS modules as it lets me be sure that my CSS is not clobbering anything.
I'm using webpacker through rails, and I'd like to use CSS modules from my rails templates.
The text was updated successfully, but these errors were encountered: