I used to rely on BootstrapCDN for my styles, but now I want to download the files and use them locally. However, when I try to load the styles without an internet connection, they don't seem to work properly, especially the grid layout.
My current setup involves using ReactJS with Material UI and Bootstrap's grid components. You can take a look at my project structure.
I've updated the stylesheet links and scripts to point to my local files, adjusting jQuery and Popper.js tags accordingly.
CSS Changes:
Changed from:
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"...>
To:
<link rel="stylesheet" href="../src/bootstrap/sources/css/bootstrap.min.css">
Updated JS Links:
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
Now:
<script src="../src/bootstrap/sources/js/bootstrap.min.js"></script>
I made similar adjustments for jQuery and Popper.js files as well.
However, even after making these changes, the grid layout is not functioning correctly. Strangely, if I include
import './bootstrap/sources/css/bootstrap.min.css';
in my /src/index.js
, where I handle private routes, the grid starts working again.
If I switch back to using BootstrapCDN and revert the links to how they were initially set up, the grid works fine without needing that extra import statement.
Could someone help me figure out what I might be doing wrong?
EDIT: I noticed in Chrome's network tab that all CSS and JS files are loading with a status code 304 - "not modified".