Importing external CSS goes kaboom
See original GitHub issueWhen I installed hack and then tried importing it I get the following error. 💥💥💥
Error in ./~/hack/dist/hack.css
Module parse failed: /Users/tristanoneil/src/saute/node_modules/hack/dist/hack.css Unexpected token (1:4)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (1:4)
@ ./src/index.js 11:0-15
Feel free to close if this just isn’t how create-react-app is intended to be used but I could see others being bit by this as well so hence the issue.
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
How can I include css files using node, express, and ejs?
1.Create a new folder named 'public' if none exists. · 2.Create a new folder named 'css' under the newly created 'public' folder ·...
Read more >import - CSS: Cascading Style Sheets - MDN Web Docs
The @import CSS at-rule is used to import style rules from other valid stylesheets. An @import rule must be defined at the top...
Read more >External CSS Stylesheets – How to Link CSS to HTML and ...
It is considered a best practice to have your CSS stylesheets in an external file. So how can you link that CSS to...
Read more >How to add CSS to Grafana - templating
I have been trying to add CSS to my CSS that looks like something like ... I can import from Boom plugin my...
Read more >14 CSS Best Practices for Beginners - Kinsta
External CSS vs. Internal CSS; Minify Your Stylesheet; Use a Preprocessor; Consider a CSS Framework; Start with a Reset; Classes vs.
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
The default config resolves CSS files only located in your
src
folder: https://github.com/facebookincubator/create-react-app/blob/master/config/webpack.config.dev.js#L70You can solve this by ejecting the config and removing the line or put another loader for external CSS.
FWIW alpha is now stable so newly created projects will just work with this, and old projects can be updated to
"react-scripts": "0.2.0"
.