Skip to content

Commit 7822307

Browse files
committed
switch to undici, update deps
1 parent fb58541 commit 7822307

File tree

3 files changed

+416
-319
lines changed

3 files changed

+416
-319
lines changed

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import {parseFragment} from "parse5";
55
import unzipper from "unzipper";
66
import urlToolkit from "url-toolkit";
77
import crxToZip from "./crx-to-zip.js";
8-
import nodeFetch from "node-fetch";
8+
import {fetch as undiciFetch} from "undici";
99
import fetchEnhanced from "fetch-enhanced";
1010

11-
const fetch = fetchEnhanced(nodeFetch, {undici: false});
11+
const fetch = fetchEnhanced(undiciFetch, {undici: true});
1212
const clone = cloner();
1313

1414
async function extract(res) {
@@ -71,7 +71,7 @@ function extractCssFromJs(js) {
7171
onToken: token => {
7272
if (token.type.label === "string") {
7373
const str = token.value.trim()
74-
.replace(/\n/gm, "")
74+
.replace(/\n/g, "")
7575
.replace(/^\);}/, ""); // this is probably not universal to webpack's css-in-js strings
7676

7777
if (str.length > 25 && isValidCSS(str)) { // hackish treshold to ignore short strings that may be valid CSS,

0 commit comments

Comments
 (0)