Seems Webpack 2.* ExtractTextPlugin loader syntax smart merging is not working
See original GitHub issueAssume we have webpack.common.js with follow loader section:
//...
module: {
rules: [
//...
{
test: /\.css$/,
loader: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
{
loader: 'css-loader',
options: {
import: false,
url: false,
sourceMap: true,
},
},
],
}),
//...
},
],
},
//...
And in weback.test.js I want override this css loader typing:
var merge = webpackMerge.smart
return merge(commonConfig, {
module: {
rules: [
{
test: /\.css$/,
use: [{
loader: 'null-loader',
}],
},
],
},
}
I get the following error:
TypeError: entry.loader.match is not a function at uniteEntries (\node_modules\webpack-merge\lib\join-arrays-smart.js:130:42) at arrayIncludesWith \node_modules\lodash_arrayIncludesWith.js:15:9)
The root cause is in the new ExtractTextPlugin syntax, which is not an array, or string, but it is a function written to loader property.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:10 (6 by maintainers)
Top Results From Across the Web
extract text plugin - ExtractTextPlugin not working at webpack 2
I found the solution: const ExtractTextPlugin = require("extract-text-webpack-plugin"); const extractSass = new ExtractTextPlugin({ filename: "[name].
Read more >webpack/webpack - Gitter
Hi guys, we recently ported over our configuration from webpack 1.12.X to webpack 2.2.0-rc.3. And so far so good, our config has changed...
Read more >How to conquer Webpack 4 and build a sweet React app
In this article, I'll go through how to set up a React application using Webpack 4. By the end of this tutorial, you'll...
Read more >webpack has been initialised using a configuration object that ...
Invalid configuration object: Webpack has been initialized using a configuration object that does not match the API schema.
Read more >Webpack Sass / Scss compiling to separate file - JonathanMH
npm install css-loader node-sass sass-loader webpack@2.2.0-rc.4 extract-text-webpack-plugin. Now let's say we have a project structure for a ...
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 Free
Top 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

I’ll drop support for
merge.smartandmerge.smartStrategyin the next major version as it’s tricky to support due to different webpack versions and overall complexity.Can you rewrite the configuration in terms of regular
mergeormergeStrategy? I use solelymergefor all of my personal work as it’s predictable.@sqfbeijing It’s tricky. I would push both behind a function or something to merge and then compose based on target. Less magic and cleaner as well.