Brunch throws on CSS imports w/o css-modules
See original GitHub issueDescription
Brunch doesn’t require CSS. In projects like Spectacle there are require
s like these:
if (useDarkTheme) {
require("../themes/default/dark.codemirror.css");
} else {
require("../themes/default/light.codemirror.css");
}
Brunch can’t handle such require
s, so it fails:
Quite confusing, because it’s problem with vendor not with my code itself.
Expected behavior
When Brunch meet styles require
, then require
should return a string with styles (?) or css-modules object (if they are enabled) and empty object (if they are disabled). I think it have to be discussed.
Actual behavior
Style modules isn’t defined and JS errors occurs.
Other useful files, when present (log, bower.json
etc.)
- Also mentioned in brunch/brunch#1473
- Related issue in FormidableLabs/spectacle#291
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Does brunch support npm packages with css modules? #1473
I'm trying to use an npm module that imports its own bundled css modules. e.g. ... Brunch throws on CSS imports w/o css-modules...
Read more >CSS Modules Import is not applying css to html for "react-scripts"
Look at your import, there is a typo in the filename. Try changing it to. import styles from './App.Module.css';. If that doesn't work, ......
Read more >Using CSS Module Scripts to import stylesheets - web.dev
Learn how to use CSS module scripts to import CSS stylesheets using the same syntax as JavaScript modules.
Read more >CSS Modules-in-CSS Module Scripts - daverupert.com
Given this import statement: import sheet from './styles.css' assert {type: 'css'}; I don't see common ground between frameworks: – Web ...
Read more >CSS Modules with React: The Complete Guide | by Suraj KC
CSS module makes CSS classes local for every component declared within by adding hashes in class names which are unique to each component,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I cannot require css even though
postcss-brunch
is installed. Or brunch will NEVER be able to require css?@shvaikalesh
Is this the way to enable it?