Skip to content

Commit

Permalink
Merge pull request #124 from TehShrike/2018-10-remove-es-build
Browse files Browse the repository at this point in the history
Remove ES module build
  • Loading branch information
TehShrike authored Dec 4, 2018
2 parents 0f5efc8 + 33a7ee4 commit 64e5720
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 21 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# [3.0.0](https://github.com/KyleAMathews/deepmerge/releases/tag/v3.0.0)

- drop ES module build [#123](https://github.com/KyleAMathews/deepmerge/issues/123)

# [2.2.1](https://github.com/KyleAMathews/deepmerge/releases/tag/v2.2.1)

- bug: typescript export type was wrong [#121](https://github.com/KyleAMathews/deepmerge/pull/121)
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"url": "git://github.com/KyleAMathews/deepmerge.git"
},
"main": "dist/umd.js",
"module": "dist/es.js",
"engines": {
"node": ">=0.10.0"
},
Expand Down
19 changes: 4 additions & 15 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,13 @@ Merges the enumerable attributes of two or more objects deeply.
> UMD bundle is 567B minified+gzipped

### Migration from 1.x to 2.0.0
### Migration from 1.x to 2+

[***Check out the changes from version 1.x to 2.0.0***](https://github.com/KyleAMathews/deepmerge/blob/master/changelog.md#200)

For the legacy array element-merging algorithm, see [the `arrayMerge` option below](#arraymerge).


### Webpack bug

If you have `require('deepmerge')` (as opposed to `import merge from 'deepmerge'`) anywhere in your codebase, Webpack 3 and 4 have a bug that [breaks bundling](https://github.com/webpack/webpack/issues/6584).

If you see `Error: merge is not a function`, add this alias to your Webpack config:

```
alias: {
deepmerge$: path.resolve(__dirname, 'node_modules/deepmerge/dist/umd.js'),
}
```


## Getting Started

### Example Usage
Expand Down Expand Up @@ -93,9 +80,11 @@ var merge = require('deepmerge')

ES Modules:
```
import merge from 'deepmerge'
import * as deepmerge from 'deepmerge'
```

(support for `import merge from 'deepmerge'` was removed because of a [Webpack bug](https://github.com/webpack/webpack/issues/6584)).


# API

Expand Down
9 changes: 4 additions & 5 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import resolve from 'rollup-plugin-node-resolve'
import commonjs from 'rollup-plugin-commonjs'

var pkg = require('./package.json')
const pkg = require(`./package.json`)

export default {
input: 'index.js',
name: 'deepmerge',
input: `index.js`,
name: `deepmerge`,
plugins: [
commonjs(),
resolve(),
],
output: [
{ file: pkg.main, format: 'umd' },
{ file: pkg.module, format: 'es' },
{ file: pkg.main, format: `umd` },
],
}

0 comments on commit 64e5720

Please sign in to comment.