File tree Expand file tree Collapse file tree 3 files changed +416
-319
lines changed Expand file tree Collapse file tree 3 files changed +416
-319
lines changed Original file line number Diff line number Diff line change @@ -5,10 +5,10 @@ import {parseFragment} from "parse5";
5
5
import unzipper from "unzipper" ;
6
6
import urlToolkit from "url-toolkit" ;
7
7
import crxToZip from "./crx-to-zip.js" ;
8
- import nodeFetch from "node-fetch " ;
8
+ import { fetch as undiciFetch } from "undici " ;
9
9
import fetchEnhanced from "fetch-enhanced" ;
10
10
11
- const fetch = fetchEnhanced ( nodeFetch , { undici : false } ) ;
11
+ const fetch = fetchEnhanced ( undiciFetch , { undici : true } ) ;
12
12
const clone = cloner ( ) ;
13
13
14
14
async function extract ( res ) {
@@ -71,7 +71,7 @@ function extractCssFromJs(js) {
71
71
onToken : token => {
72
72
if ( token . type . label === "string" ) {
73
73
const str = token . value . trim ( )
74
- . replace ( / \n / gm , "" )
74
+ . replace ( / \n / g , "" )
75
75
. replace ( / ^ \) ; } / , "" ) ; // this is probably not universal to webpack's css-in-js strings
76
76
77
77
if ( str . length > 25 && isValidCSS ( str ) ) { // hackish treshold to ignore short strings that may be valid CSS,
You can’t perform that action at this time.
0 commit comments