Fitbit / webpack-config

Helps to load, extend and merge webpack configs
https://fitbit.github.io/webpack-config
Apache License 2.0
252 stars 18 forks source link

Feature: optional extend (aka silently fail on missing file) #83

Open airtonix opened 7 years ago

airtonix commented 7 years ago

right now we have two ways to build up an eventual configuration object from other files:


export default new Config().extend({
  'core/foo': (config) => {
    config.bar.forEach( (item) => { item.name = `${item.name}-foo`; })
  }
})

or

export default new Config()
  .extend('core/foo');

At the moment, if core/foo doesn't exist, then an error is thrown.

instead, let's specify a way to relax errors for missing files, then default to extending an empty object.

mdreizin commented 7 years ago

@airtonix I will try to find better way to do that and will post solution here before final merge.