webpack-config icon indicating copy to clipboard operation
webpack-config copied to clipboard

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

Open airtonix opened this issue 8 years ago • 1 comments

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.

airtonix avatar Mar 08 '17 02:03 airtonix

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

mdreizin avatar Mar 08 '17 12:03 mdreizin