Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ES module build #124

Merged
merged 2 commits into from
Dec 4, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 * from 'deepmerge'
TehShrike marked this conversation as resolved.
Show resolved Hide resolved
```

(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` },
],
}