Incorporating third-party libraries is an essential part of my project. For example, I have Mapbox GL installed via npm, which comes with CSS files needed for its functionality.
The Mapbox GL CSS file can be found at mapbox-gl/dist/mapbox-gl.css
in the node_modules
directory. In my index.html file, which serves as the entry point for my React application, there is a link to a CSS file containing default styles:
<link rel="stylesheet" href="/vendor/core.css">
While most CSS rules are written using CSS modules within specific React UI components, I occasionally need to import vendor CSS files like Mapbox GL. How can I import these vendor CSS files and ensure that their styles apply across the entire application?