oneCoderToRuleThemAll
oneCoderToRuleThemAll

Reputation: 865

React/CSS: Using CSS stylesheets in a React app?

I have normal css file I would like to use in my React app which is not using webpack. When I try to import the css file, I get the below error:

Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
> @import url("https://fonts.googleapis.com/css?family=Ubuntu:400,400i,700,700i");

Based on some posts that I have seen online, it looks like you have to webpack and customize it to load the css stylesheet. But is there a way to use my existing stylesheet without webpack ?

Upvotes: 0

Views: 37

Answers (1)

Ladi Adenusi
Ladi Adenusi

Reputation: 1082

You can add the following line in between the <head> of your index.html instead...

<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Ubuntu:400,400i,700,700i">

Upvotes: 3

Related Questions