From 69e278bbdbf453e2c92b8b2abc671135264274b0 Mon Sep 17 00:00:00 2001 From: asins Date: Fri, 21 Apr 2023 11:53:10 +0800 Subject: [PATCH 1/2] feat: supper esm module --- package.json | 3 ++- rollup.config.js | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 2b7b1be..7926106 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,8 @@ "type": "git", "url": "git://github.com/TehShrike/deepmerge.git" }, - "main": "dist/cjs.js", + "main": "dist/deepmerge.cjs.js", + "module": "dist/deepmerge.esm.js", "engines": { "node": ">=0.10.0" }, diff --git a/rollup.config.js b/rollup.config.js index 8323ab2..4695836 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -10,12 +10,18 @@ export default { ], output: [ { + name: 'deepmerge', file: pkg.main, format: `cjs` }, { name: 'deepmerge', - file: 'dist/umd.js', + file: pkg.module, + format: `es` + }, + { + name: 'deepmerge', + file: 'dist/deepmerge.umd.js', format: `umd` }, ], From 0d0dc6525ce6fbad64ac4c4c7f8c49047aa9a710 Mon Sep 17 00:00:00 2001 From: asins Date: Fri, 21 Apr 2023 12:18:41 +0800 Subject: [PATCH 2/2] feat: add typings attr to package.json --- index.js | 2 +- package.json | 3 ++- rollup.config.js | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 77968ae..b534604 100644 --- a/index.js +++ b/index.js @@ -103,4 +103,4 @@ deepmerge.all = function deepmergeAll(array, options) { }, {}) } -module.exports = deepmerge +export default deepmerge; diff --git a/package.json b/package.json index 7926106..89fb1f7 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "clone", "recursive" ], - "version": "4.3.1", + "version": "4.3.2", "homepage": "https://github.com/TehShrike/deepmerge", "repository": { "type": "git", @@ -17,6 +17,7 @@ }, "main": "dist/deepmerge.cjs.js", "module": "dist/deepmerge.esm.js", + "typings": "index.d.ts", "engines": { "node": ">=0.10.0" }, diff --git a/rollup.config.js b/rollup.config.js index 4695836..39e4413 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -12,6 +12,7 @@ export default { { name: 'deepmerge', file: pkg.main, + exports: 'named', format: `cjs` }, {