Skip to content
This repository has been archived by the owner on Jun 18, 2019. It is now read-only.

Extending duplicate deeply-nested configs #103

Open
matthew-dean opened this issue Sep 1, 2017 · 1 comment
Open

Extending duplicate deeply-nested configs #103

matthew-dean opened this issue Sep 1, 2017 · 1 comment

Comments

@matthew-dean
Copy link

matthew-dean commented Sep 1, 2017

Problem: I am using Nuxt.js which exports an extendable config for webpack. I'd like to extend "sass-loader" in that config, BUT...

  1. The root list of module loaders contains both "vue-loader" and "sass-loader", with respective options.
  2. Under "vue-loader" options, it contains a loaders property, which has a sub-property of sass, which contains an array of loaders, ONE of which is "sass-loader", which then, of course has a list of duplicated options for "sass-loader".

I'd like to use webpack-config to extend/merge instances of "sass-loader" wherever { loader: 'sass-loader' } is found in the entire config sub-tree. (Ideally, I would also check that the exported config doesn't have any variation between duplicate loader options.)

Can a feature be added where merging includes a deep key/value lookup of the object tree, and then merges the options at that location? Or can you think of another way to do this?

Thanks.

@mdreizin
Copy link
Contributor

mdreizin commented Nov 1, 2017

Hello @matthew-dean, I'm really sorry that I didn't respond earlier. Better late than never.

Yes, it sould be possible.

ConfigMergeCommand.js uses simple implementation based on lodash, but it could be replaced with webpack-merge. It is designed especially for merging webpack-configs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants