0

Hello in my react js project I include <link> 's of blueprint.js library but browser does not recognize them. Instead I import them in index.js file then it works. Can someone briefly explain why browser does not recognize them?

index.html

<link rel="stylesheet" type="text/css" href="./src/index.css" />
<!-- add other blueprint-*.css files here -->
<link href="./node_modules/normalize.css/normalize.css" rel="stylesheet" />
<!-- blueprint-icons.css file must be included alongside blueprint.css! -->
<link href="./node_modules/@blueprintjs/icons/lib/css/blueprint-icons.css" rel="stylesheet" />
<link href="./node_modules/@blueprintjs/core/lib/css/blueprint.css" rel="stylesheet"/>

index.js

import 'normalize.css'
import '@blueprintjs/core/lib/css/blueprint.css'
import '@blueprintjs/icons/lib/css/blueprint-icons.css';

when i comment out of my import index.js web browser does not include links why?

tron
  • 113
  • 3
  • 10

1 Answers1

0

node_modules won't exist when you build your project, so it is outside of scope. You would only be able to reference things from the index.html that are within the public folder or externally (like a CDN)

bilwit
  • 799
  • 1
  • 5
  • 9