Questions tagged [webpack-style-loader]
461 questions
21
votes
4 answers
“You may need an appropriate loader to handle this file type” with Webpack and CSS
I an new to webpack, and I have been able to get it to packup my javascript, but the CSS eludes me. I keep getting a:
“You may need an appropriate loader to handle this file type”
One the first line of my css file. The CSS file is simple:
body {
…

TexasNeo
- 592
- 1
- 3
- 12
20
votes
2 answers
css-loader not importing .css file returning empty object
Importing style from css files. Returning empty object. Seems css-loader is not working correctly. Can anyone help me on this. Please find the reference files below
index.js
import React from 'react'
import style from…

Gopinath Shiva
- 3,822
- 5
- 25
- 48
18
votes
2 answers
Example of how to load static CSS files from node_modules using webpack?
I don't know how to load with webpack any CSS from node_modules libs, for example I've installed leaflet and each attempt of load leaflet/dist/leaflet.css fails.
Could you provide example how to load static styles from node_modules?
My current…

luzny
- 2,380
- 7
- 30
- 64
17
votes
3 answers
Angular Application Doesn't load up App Module/Components after Upgrade to Angular 8.3.5
We have an Angular 4 project that I've recently tried to upgrade to Angular 8. I followed the migration guide in Angular website, changed some of the syntaxes, and everything preventing project to be built. I faced the problem of my styles were not…

Mustafa Mohammadi
- 1,433
- 1
- 12
- 25
17
votes
4 answers
'window is not defined' error when using style-loader with webpack
Building a server side react app and while using Webpack I am having issues with Style-Loader.
I am using version "^0.23.1" and when running a script to bundle and build there is an issue from Style-Loader.
The issue is window is not…

T. Evans
- 959
- 3
- 14
- 27
16
votes
2 answers
Inject CSS Modules to Per-Component Style Elements (for portability to shadow root)
TL:DR
How can I get CSS of React components to work inside of a shadow root, while keeping the
encapsulation benefits of CSS Modules class? I'd like to insert per-component