How do you include a CSS file from node_modules without it prefixing?
See original GitHub issueWhen I do …
import 'react-select/dist/react-select.css';
Then the css is dumped to the page but with all of the extra stuff in the name, expecting that I’ll be using the withStyles method, but it’s not my component and doesn’t use that method. With how all of this is configured, how can I bypass the renames?
Would it be a good idea to modify this starter kit to have a css loader for anything in the node_modules directory where it doesn’t do all the class renaming since components asking you to include their css this way is common and the current set up breaks the css.
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Import CSS from "node_modules" in Webpack - Stack Overflow
You can import files relative to your project's root (resolving node_modules/ from the root folder) by prefixing with a tilde ~ :
Read more >How do I include node_modules css files? #1789 - GitHub
I'm having a hard time figuring this out. I have all these node_modules which include the css files I need but I can...
Read more >CSS - Parcel
To use CSS modules, create a file with the .module.css extension, and import it from a JavaScript file with a namespace import. Then,...
Read more >css-loader | webpack - JS.ORG
file.js import css from "file.css";. webpack.config.js ... assets from a node_modules path (include resolve.modules ) and for alias , prefix it with a...
Read more >Working with CSS - Vue CLI
Note if you want to reference a file inside an npm dependency or via webpack alias, the path must be prefixed with ~...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
it works for me to add
@import ‘~bootstrap/dist/css/bootstrap’; @import ‘~bootstrap/dist/css/bootstrap-theme’; in core.scss
Replace postcss-import with postcss-partial-import and use like so: