Unexpected Webpack2 `use` merge
See original GitHub issueGiven the following merge:
merge.smart({
rules: [{
test: /\.js$/,
use: 'babel'
}]
}, {
rules: [{
test: /\.js$/,
use: 'coffee'
}]
});
I would expect the following according to the what the Webpack1 examples seem to suggest in the README:
{
rules: [{
test: /\.js$/,
use: 'coffee'
}]
}
Instead I get:
{
rules: [{
test: /\.js$/,
use: ['babel','coffee']
}]
}
There doesn’t seem to be a way to overwrite a string value in use as it always gets converted to an array and merged.
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (8 by maintainers)
Top Results From Across the Web
Webpack unexpected token - Urigo/merge-graphql-schemas
I am using Webpack to compile, running into an issue when trying to call fileLoader on types directory.. Webpack config const path =...
Read more >Getting error when running npm-run after git merging conflicts
I get the following error when I run npm run watch/npm run dev after a git merge where I resolved some conflicts manually:....
Read more >Webpack isn't noticing your file changes. Did you do ...
You're suffering from a stale file cache. And I have great news: it's easy to diagnose and even easier to resolve. Don't delete...
Read more >"[webpack] 'dist': web-part.js from UglifyJs Unexpected token ...
We were using all the latest npm packages in the web part and the web part was also working in ... const merge...
Read more >Code Splitting - webpack
Entry Points: Manually split code using entry configuration. ... Let's take a look at how we might split another module from the main...
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 made a little fix. I think you should be able to use
now to achieve the behavior you described.
Let’s leave this issue open for now, though, as this needs careful thought. It would be tempting to drop smart merging in 3.0 as it’s strategies that are valuable, not folding.
@bmayen Ok, I’ll check that tomorrow. There’s something else biting.
useis definitely complex to handle.