From 5b812443fe39651a650f859e0ba258c8626e42e3 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Fri, 9 Oct 2020 13:05:11 -0700 Subject: [PATCH 1/2] Add `webpack` condition, so webpack loads es6 module version Even when handling the `exports` table, as done in `webpack` 5. `webpack` 5, at least at present, doesn't handle esm/cjs interop the same way as `node`, so we can;t use the same source as in `node`. --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 7b1f61b..0bc9d45 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "sideEffects": false, "exports": { ".": { + "webpack": "./tslib.es6.js", "import": "./modules/index.js", "default": "./tslib.js" }, From ee82cf4658418cd2688cc3dbccb7099a802550c5 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Fri, 9 Oct 2020 13:58:41 -0700 Subject: [PATCH 2/2] Use `module` over `webpack` to be a little bit more tool agnostic --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0bc9d45..3b1abd9 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "sideEffects": false, "exports": { ".": { - "webpack": "./tslib.es6.js", + "module": "./tslib.es6.js", "import": "./modules/index.js", "default": "./tslib.js" },