-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Empty object importing from node_modules css module #368
Comments
This is because parcel scopes configuration to a module level, so your |
This isn't really a great solution as adding a postcssrc very time I update the library is pretty inconvenient. Is there another way of doing this? |
@devongovett Any reason for this not to be handled automatically by parcel? |
This type of global configuration is dangerous. If the library you are importing from wasn't designed to use CSS modules, then if you overrode that in your application the original class names wouldn't be there and things probably wouldn't work correctly since the markup/javascript would still have the original classes not the css module ones. |
@devongovett That makes sense, but there still isn't a solution to the problem other than adding a .postcssrc to a library that may be overwritten by updates. |
Perhaps this should at least be mentioned on the Parcel site when mentioning PostCSS https://parceljs.org/transforms.html#postcss Since Parcel should be easy to setup this brings with a lump of confusion for those wanting to just explore the technology. |
Any change that it should be done somehow without putting .postcssrc into another libraries (eg. some parameter/configuration in parcel)? First of all it feels rather wrong to me that I should put some file into library that I installed in my project. Secondly - this seems to just not work. I created .postcssrc file with modules set to true in the root of react-toolbox in my project and it still didn't import css modules correctly. If I could create some plugin for parcel or add some parameter/configuration for it in order to process css modules from modules imported from node_modules, it would be awesome is someone could point me to a place in code when I should start investigation. |
Has this been solved? I am trying to get React and stuff works fine, but an unstyled page looks back at me. How do I get |
@Overbryd It's ugly but it works (on unix-like systems at least...) {
"scripts":{
"support-postcss-modules-react-toolbox":
"echo '{\"modules\": true}' > node_modules/react-toolbox/.postcssrc",
}
} |
@devongovett Perhaps there can be an option to completely skip any transformations if a |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. |
I've been trying to import tachyons like a css module without success.
Outputs
{}
while moving the file and importing locally./
works. The path is correct and changing the path produces an error.I've tried importing with path
../node_modules/tachyons/css/tachyons.css
🎛 Configuration (.babelrc, package.json, cli command)
.postcssrc
🤔 Expected Behavior
I'm expecting the import to work like a css module when importing from node_modules or a relative path like
../node_modules/tachyons/css/tachyons.css
.😯 Current Behavior
Outputs
{}
.💁 Possible Solution
🔦 Context
🌍 Your Environment
node v9.3.0
macOS High Sierra
The text was updated successfully, but these errors were encountered: