The mini-css-extract-plugin extracts CSS into separate files. It creates a CSS file per JS file which contains CSS. It supports On-Demand-Loading of CSS and SourceMaps.
Questions tagged [mini-css-extract-plugin]
185 questions
0
votes
1 answer
WebPack: Background image not loading
Trying to load a CSS background image, defined in SCSS, and serving via WebPack devServer.
The background image defined in SCSS is picked up by WebPack, but it doesn't show on the page.
I have tried setting publicPath option in…

Dimitri Dhuyvetter
- 84
- 7
0
votes
1 answer
webpack4 vue The parent component covers the style of the child component
父组件 (Parent component)
子组件 (Child…
0
votes
1 answer
MiniCssExtractPlugin error on entry point build
We use webpack to bundle our resources before deployment. However, now we want to also bundle our sass files through webpack is it simplifies our build process. Now, we do have an issue where the MiniCssExtractPlugin claims that webpack_require is…

Enigmatic
- 370
- 2
- 11
0
votes
1 answer
How to compile style.sass to style.css and keep indentation
I´m beggining with webpack to make a Wordpress theme.
I would like to compile sass files to css files.
The goal is to compile style.sass to style.css without minify and keeping the standard comment header.
webpack.config.js
const path =…

J.BizMai
- 2,621
- 3
- 25
- 49
0
votes
1 answer
Webpack 4 Upgrade - Suspected mini-css-extract-plugin - CSS Never Loads - Uncaught SyntaxError: Unexpected token
I've upgraded from webpack v2 to webpack v4 - because extract text plugin no longer exists I've replaced it with MiniCssExtract plugin and had to hold off upgrading so I could process filenames as a function.
Now that this is available I'm running…

Tom
- 73
- 1
- 8
0
votes
0 answers
Laravel mix 4 (Webpack 4) & React CSS modules
Having around 20 vulnerabilities in my current package.json I decided to begin upgrading them.
After an npm audit fix --force webpack (& laravel mix) has been updated from 2.x to 4.x.
I am running a React webapp with CSS modules (react-css-modules)…

user2191227
- 392
- 3
- 15
0
votes
1 answer
webpack non-entry filenames
webpack.config.js
const webpack = require('webpack');
const path = require('path');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const fs =…

Killerpixler
- 4,200
- 11
- 42
- 82
0
votes
1 answer
webpack css-loader escaping issue
I'm using
macOS Mojave 10.14 (18A391)
Node.js 11.13.0
npm 6.7.0
webpack 4.29.6
css-loader 2.1.1
sass 1.17.3
sass-loader 7.1.0
mini-css-extract-plugin 0.5.0
Expected Behavior
Rendered HTML
CSS class is rendered as I…

Altaula
- 774
- 1
- 7
- 22
0
votes
1 answer
How to have global css styles alongside in-js component styles using Webpack and Angular?
I have a Webpack + Angular project and I want to have a separate global stylesheet alongside the component styles, similar to what angular-cli does out of the box. I am using sass for the component styles, and want to have a global tailwind built…

ge022
- 134
- 1
- 7
0
votes
1 answer
Webpack SCSS config
I have the following webpack setup:
let config= {
mode: 'development',
entry: {
'templates': '/usr/local/var/www/project/src/ts/entry/templates.ts',
'templates2': '/usr/local/var/www/project/src/ts/entry/templates2.ts',
…

Yaron
- 1,655
- 6
- 20
- 38
0
votes
0 answers
Webpack: extract css for certain endpoints
I have a multi-endpoint webpack setup with sass and MiniCssExtractPlugin. Everything works fine and css is extracted for every endpoint.
Now I am looking for a way to only extract css for certain endpoints, but not the others. Is it possible to…

dmitrybelyakov
- 3,709
- 2
- 22
- 26
0
votes
0 answers
Introducing images with relative paths in scss will cause postcss to fail
I configured this in webpack.
At the beginning, postcss can take effect, but if you introduce the image in scss, you will report such an error, so I added publicPath to postcss and found that no error was reported, but a new problem occurred. At…

returnTrue
- 1
- 2
0
votes
1 answer
webpack sass-loader and `MiniCssExtractPlugin.loader` did not compile scss file into css
Is there anything wrong with my webpack config? I followed tutorials online everywhere says the same way to config. But I think I must have missed something.
webpack.common.js
const path = require('path');
const CleanWebpackPlugin =…

ey dee ey em
- 7,991
- 14
- 65
- 121
0
votes
0 answers
Build only scss files to css prevent compiling/building the JS or build only js while preventing compiling scss using webpack 4
So I am trying to create only css files or only js files at a time from the index.js file, which import few react component.
.
├── index.js
├── Header
├── index.js
└── styles.scss
└── Body
├── index.js
└──…

Subhendu Kundu
- 3,618
- 6
- 26
- 57
0
votes
1 answer
mini-css-extract-plugin TypeError: Cannot match against 'undefined' or 'null'
I have been using mini-css-extract-plugin for a while for my css module dynamic import but suddenly it was breaking webpack build.
It is webpack 4

fiddlest
- 1,262
- 2
- 17
- 42