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

Document merge function import

Open IlyaSemenov opened this issue 6 years ago • 4 comments

Here https://github.com/mozilla-neutrino/webpack-chain#config-module-rules-uses-loaders-modifying-options the example says:

config.module
  .rule('compile')
    .use('babel')
      .tap(options => merge(options, { plugins: ['babel-plugin-syntax-object-rest-spread'] }));

However it's not mentioned anywhere where merge is supposed to come from. I believe that should be documented at least once.

IlyaSemenov avatar Jun 20 '18 07:06 IlyaSemenov

I hope this should be documented. I imported merge like const merge = require('deepmerge').

ducky-hong avatar Jun 21 '18 08:06 ducky-hong

@eliperelman is this example referring to deepmerge's merge() or that from babel-merge? I'm presuming the latter?

edmorley avatar Jun 21 '18 17:06 edmorley

I left it as generic at the time so users could implement how they saw fit, but using babel-merge is probably the best way.

eliperelman avatar Jun 21 '18 17:06 eliperelman

I had success with webpack-merge:

var merge = require('webpack-merge');

luckydonald avatar Nov 27 '18 17:11 luckydonald