Skip to content

Generate a manifest json of export tokens #36

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

Merged
merged 2 commits into from
Aug 26, 2015
Merged

Generate a manifest json of export tokens #36

merged 2 commits into from
Aug 26, 2015

Conversation

joshwnj
Copy link
Member

@joshwnj joshwnj commented Aug 24, 2015

This adds an optional json config (or --json via CLI). If provided, all export tokens are written to a json file (indexed by source css filename).

I haven't tried using this but wanted to see if people are interested in trying it. Could potentially open up a way to use css-modules with non-js backends.

@joshgillies
Copy link
Member

Nice! Might be worth adding an "advanced usage" section to the ReadMe, outlining where this would be useful?

@joshwnj
Copy link
Member Author

joshwnj commented Aug 24, 2015

Yeah, or like a "Using css-modules on the backend". We can mention the require hook for people using node, and json manifest for others.

updated readme

make the manifest a bit nicer by normalizing filenames to the root directory

updated readme

make the manifest a bit nicer by normalizing filenames to the root directory
joshwnj added a commit that referenced this pull request Aug 26, 2015
Generate a manifest json of export tokens
@joshwnj joshwnj merged commit dec6001 into master Aug 26, 2015
@joshwnj joshwnj deleted the json-manifest branch August 27, 2015 01:27
@wbyoung
Copy link

wbyoung commented Jan 14, 2017

For what it's worth, it took me finding this issue to understand better the comment on the README:

Option B: configure the jsonOutput option with a file path and css-modulesify will generate a JSON manifest of classnames.

I was confused because writing a manifest is helpful in a sense, but still means that whatever JS code you have can't be used (without some alteration) for both the front end and the backend.

Also, in case you're interested (since the PostCSS community still seems to be new & growing), I've written a babel transform that can handle CSS modules and all async PostCSS plugins that I'm using with Browserify for the frontend and transplied for the backend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants