Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

webpack-merge

Package Overview
Dependencies
Maintainers
1
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpack-merge - npm Package Compare versions

Comparing version 4.0.0 to 4.1.0

5

CHANGELOG.md

@@ -0,1 +1,6 @@

4.1.0 / 2017-03-16
==================
* Feature - `merge.multiple` to allow working with webpack multi-compiler mode. It accepts multiple objects and returns an array you can push to webpack. #74
4.0.0 / 2017-03-06

@@ -2,0 +7,0 @@ ==================

'use strict';
var _values2 = require('lodash/values');
var _values3 = _interopRequireDefault(_values2);
var _unionWith2 = require('lodash/unionWith');

@@ -73,2 +77,10 @@

var mergeMultiple = function mergeMultiple() {
for (var _len3 = arguments.length, sources = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
sources[_key3] = arguments[_key3];
}
return (0, _values3.default)(merge(sources));
};
// rules: { <field>: <'append'|'prepend'|'replace'> }

@@ -142,2 +154,3 @@ // All default to append but you can override here

module.exports = merge;
module.exports.multiple = mergeMultiple;
module.exports.smart = mergeSmart;

@@ -144,0 +157,0 @@ module.exports.strategy = mergeStrategy;

2

package.json

@@ -5,3 +5,3 @@ {

"author": "Juho Vepsalainen <bebraw@gmail.com>",
"version": "4.0.0",
"version": "4.1.0",
"scripts": {

@@ -8,0 +8,0 @@ "build": "babel src -d lib",

@@ -315,2 +315,39 @@ [![build status](https://secure.travis-ci.org/survivejs/webpack-merge.svg)](http://travis-ci.org/survivejs/webpack-merge) [![bitHound Score](https://www.bithound.io/github/survivejs/webpack-merge/badges/score.svg)](https://www.bithound.io/github/survivejs/webpack-merge) [![codecov](https://codecov.io/gh/survivejs/webpack-merge/branch/master/graph/badge.svg)](https://codecov.io/gh/survivejs/webpack-merge)

## Multiple Merging
### **`merge.multiple(...configuration | [...configuration])`**
Sometimes you may need to support multiple targets, *webpack-merge* will accept an object where each key represents the target configuration. The output becomes an *array* of configurations where matching keys are merged and non-matching keys are added.
```javascript
var path = require('path');
var baseConfig = {
server: {
target: 'node',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'lib.node.js'
}
},
client: {
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'lib.js'
}
}
};
// specialized configuration
var production = {
client: {
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].[hash].js'
}
}
}
module.exports = merge.multiple(baseConfig, production)
```
> Check out [SurviveJS - Webpack and React](http://survivejs.com/) to dig deeper into the topic.

@@ -317,0 +354,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc