Questions tagged [webpack-style-loader]
461 questions
8
votes
2 answers
Webpack sometimes fails to detect changes saved with Intellij Idea
I'm developing a JavaScript/React application in Intellij Idea and I'm using webpack-dev-server to incrementally build my files. That means that the dev server is watching the files and if a file gets changes, webpack rebuilds it. Pretty standard…

tobik
- 7,098
- 7
- 41
- 53
8
votes
3 answers
Is it possible to inject NODE_ENV param into sass file using Webpack & sass loader?
I'm trying to inject NODE_ENV into a sass file, so I can have different output for dev/prod env, and have a sass function that has a condition like that inside it:
@if (NODE_ENV == 'prod') {}
my webpack.config looks like this:
module: {
loaders:…

Dima Feldman
- 708
- 1
- 10
- 17
8
votes
2 answers
Webpack loader aliases?
I have a fairly complicated loader setup for style sheets:
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract("style",
"css?sourceMap&localIdentName=[path][name]__[local]__[hash:base64:5]!sass?outputStyle=expanded&" +
…

Brigand
- 84,529
- 20
- 165
- 173
8
votes
1 answer
webpack css-loader image paths need to remain relative to stylesheet location
I need all iamges to be relative to the stylesheet local. If I add root=. , which I though prepended to url(/path/) then I need to add a file-loader and the path is wrong anyway.
If I write relative path directly in the CSS then I also need to use…

Andreas
- 327
- 2
- 6
7
votes
1 answer
Load styles only if component has been imported in Vue.js
I have a Vue.js project using Vue UI with Webpack project using router for multiple "pages". I am using SASS (SCSS) partials and importing them in the individual components.