Questions tagged [extract-text-plugin]
121 questions
4
votes
2 answers
How to specify multiple loaders in Webpack plugin?
My Webpack config contains the following loaders.
module: {
loaders: [
{ test: /\.js$/, loader: "babel", exclude: /node_modules/ },
{ test: /\.sass$/, loaders: ["style-loader", "css-loader", "sass-loader"], exclude: /node_modules/ }
…
user1675891
3
votes
1 answer
Error: composition is only allowed when selector is single :local class name
I can't make ExtractTextPlugin work with css-loader. I get the following error if I run webpack -p:
ERROR in ./node_modules/css-loader!./app/components/ErrorMessage/styles.css
Module build failed: Error: composition is only allowed when selector is…

anlogg
- 1,050
- 1
- 15
- 36
3
votes
0 answers
Webpack CSS filename in JS file
I am writing a React app with create-react-app which uses Webpack and the extract-text-plugin to generate bundled js and css files. Now I would like to know the filename of the generated CSS file in my JS file, like so:
import React, { Component }…

Lukas
- 9,752
- 15
- 76
- 120
3
votes
0 answers
Webpack 3 - ExtractTextPlugin - localIdentName not applying to component from node_modules
I have a Webpack 3 setup using ExtractTextPlugin, and the localIdentName is not applying to the CSS classes generated from node_modules, specifically from the react-spinkit package.
I am using a component from react-spinkit, which is…

Andrew Parisi
- 504
- 3
- 16
3
votes
1 answer
ExtractTextPlugin in webpack for Angular 2
I have a working configuration for webpack with Angular, so that the scss files are inserted into the bundle.js
{
test: /\.scss$/,
use: ['raw-loader', 'resolve-url-loader', 'sass-loader?sourceMap']
}
but then I want instead to get a single css…

David
- 3,364
- 10
- 41
- 84
3
votes
1 answer
Can't extract multiple .css files from a single .js entry (imported multiple .scss files)?
I raised this issue at extract-text-webpack-plugin but it seems this plugin doesn't support this feature at the moment (I'm not sure).
How can I extract main.scss and home.scss into main.css and home.css in the following example?
Result: There was…

Tien Do
- 10,319
- 6
- 41
- 42
3
votes
1 answer
Extract common styles with ExtractTextPlugin and CommonsChunkPlugin
I'm trying to extract common chunk from my css according wiki section. I know that this docs is for webpack 1 but for webpack 2 seems like there is no corresponding example yet. I use the following webpack config:
module.exports = {
context:…

Invis1ble
- 1,295
- 2
- 17
- 35
3
votes
1 answer
Using ExtractTextPlugin with WebPack 2.2.0 RC3 throws errors
I'm trying to upgrade an AngularJS (Angular 1) application using WebPack 2.1.0 beta 8 to WebPack 2.2.0 RC3 but I'm having issues with the ExtractTextPlugin.
I started from the following, working, setup:
module: {
...
loaders: [{
test:…

Frederik Prijck
- 1,424
- 10
- 16
3
votes
1 answer
Webpack "cannot find module" source-map, module build failed
I'm trying to bundle project with Webpack, but I recieve an error: "Cannot find module './stylesheet/css/build.css'"
I'm using webpack 1.14.0 and yarn 0.17.10.
webpack printscreen
Please give me some advise how I should use require() to get…

Andrii Sikora
- 31
- 1
- 5
2
votes
0 answers
workbox-webpack-plugin does not update the revision version of the CSS file, generated by the extractTextWebpackPlugin.extract(...) method
I'm using Angular (custom Webpack build procedure) together with the Workbox v.3.2.0 with workbox-webpack-plugin v.3.2.0 (InjectManifest plugin) for the precaching purposes and have difficulties with revisioning of the style.css file that is…

Anatolii Kolesnyk
- 21
- 4
2
votes
1 answer
CSS not extracted for common chunk with extract-text-webpack-plugin
Not sure if this is a bug or just my setup, I am using the CommonsChunkPlugin to get a separate common.js for three entry points in my project, and using the extract-text-webpack-plugin to get the css files. My entry points are app, login and…

JerryH
- 115
- 2
- 14
2
votes
0 answers
Child extract-text-webpack-plugin in console logging too many times
I have an issue with this (the title) spamming my console. I got called onto a project that I did not write and this was one of the issues one of the devs wanted fixed.
webpackConfig.plugins.push(
new…

asegier
- 55
- 5
2
votes
2 answers
Webpack 3: Use sass-loader and ExtractTextPlugin doesn't work
I've been trying to use the sass-loader in webpack and I follow this instructions -> https://github.com/webpack-contrib/extract-text-webpack-plugin#extracting-sass-or-less but this not working.
Can anybody help me?
Repository…

Gonzalo Pincheira Arancibia
- 3,483
- 1
- 23
- 42
2
votes
0 answers
Webpack: Extracting vendor chunk breaks dynamic import()
I would like to be able to import CSS in one of my entry chunks (called "vendor") and extract it using the ExtractTextPlugin to a "vendor.css" file.
At the same time I also seek to being able to import arbitrary CSS inside chunks which are getting…

John Reese
- 583
- 2
- 6
- 17
2
votes
2 answers
Webpack 2 - redundant bundle file after text extract
Here's a public Gist of my Webpack configuration, which is essentially a slightly modified Webpack config ejected from Angular CLI:
https://gist.github.com/sparkbuzz/3cd017671751083e2af8c10a1ad37747
This Webpack build is generating styles.bundle.css…

josef.van.niekerk
- 11,941
- 20
- 97
- 157