From eeeffe77ff7cbbcd03228d2d9701b1d18214ea92 Mon Sep 17 00:00:00 2001 From: wessberg Date: Fri, 23 Oct 2020 11:29:08 +0200 Subject: [PATCH] fix: inject new.target replacement to work around swc bug --- file-content-injector.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/file-content-injector.js b/file-content-injector.js index 7e6de03..9a44644 100644 --- a/file-content-injector.js +++ b/file-content-injector.js @@ -10,6 +10,11 @@ const fs = require("fs"); file: "node_modules/@wessberg/connection-observer/dist/index.js", match: String.raw`if (new.target === undefined) {`, replacement: String.raw`if ((this instanceof ConnectionObserver ? this.constructor : void 0) === undefined) {` + }, + { + file: "/Users/wessberg/coding/polyfiller/node_modules/@polyfiller/object-fit/polyfill/index.js", + match: String.raw`if (new.target === undefined) {`, + replacement: String.raw`if ((this instanceof ComputedStyleObserver ? this.constructor : void 0) === undefined) {` } ].forEach(replace);