From 75c5d1da5a37b2fa9309c7af7d3a650b6f0b2796 Mon Sep 17 00:00:00 2001 From: Frank Lemanschik Date: Tue, 14 Jul 2020 15:01:23 +0200 Subject: [PATCH 1/2] Update index.js No Named Exports in CJS breaks nodejs interop --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index e67387f..de54c1b 100644 --- a/index.js +++ b/index.js @@ -21,4 +21,6 @@ function string(opts = {}) { }; } -exports.string = string; +//Add circl deb for backward compat to your old syntax example import { string } +string.string = string +exports = string; From 87c6f29cae2aab2c6163d43cc0ebb7c5abaf0c9e Mon Sep 17 00:00:00 2001 From: Frank Lemanschik Date: Tue, 14 Jul 2020 15:06:22 +0200 Subject: [PATCH 2/2] Update README.md This exist only as CJS version CJS has only the default exports property so fixed the docs --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4cf0ddd..654f453 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ npm i rollup-plugin-string -D ```js import { rollup } from "rollup"; -import { string } from "rollup-plugin-string"; +import string from "rollup-plugin-string"; rollup({ entry: "main.js",