I'm trying to convert an html template to a ReactJs application. Everything works fine with
<link rel="stylesheet" href="%PUBLIC_URL%/css/styles-merged.css">
in the public\index.html file but when I move the style.min.css file from the public\css folder to the src\index.js, then it does not work. I am sure that I am making a newbie mistake. What am I doing wrong?
File structure
public
index.html
src
index.js
app.js
css
style.min.css
fonts
glyphicons-halflings-regular.eot
Error:
./src/index.js Module not found: Can't resolve 'css/style.min.css' in 'c:\projects\sample\src'
public\index.html file:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--<link rel="stylesheet" href="%PUBLIC_URL%/css/styles-merged.css">-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
</head>
<body>
<div id="root"></div>
</body>
</html>
src\index.js
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import registerServiceWorker from './registerServiceWorker';
import 'css/style.min.css';
ReactDOM.render(<App />, document.getElementById('root'));
registerServiceWorker();