]> git.lizzy.rs Git - rust.git/commitdiff
Workaround rollup messing up default imports
authorVeetaha <veetaha2@gmail.com>
Wed, 8 Jul 2020 11:47:34 +0000 (14:47 +0300)
committerVeetaha <veetaha2@gmail.com>
Wed, 8 Jul 2020 11:47:34 +0000 (14:47 +0300)
editors/code/src/net.ts

index 53c9e91cd17010593c09a279dd9b0a6f3ef56a7d..681eaa9c94646b7d5905ede1bea78422465f653c 100644 (file)
@@ -1,4 +1,7 @@
-import fetch from "node-fetch";
+// Replace with `import fetch from "node-fetch"` once this is fixed in rollup:
+// https://github.com/rollup/plugins/issues/491
+const fetch = require("node-fetch") as typeof import("node-fetch")["default"];
+
 import * as vscode from "vscode";
 import * as stream from "stream";
 import * as crypto from "crypto";