File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change
1
+ import "./banana.mjs"
2
+
3
+ const str = 'import {sack} from "sack.vfs" \n\
4
+ import {local} from "./test.js" \n\
5
+ import {another} from "/node_modules/something" \n\
6
+ import * as foo from "../banana" \n\
7
+ import * as foo from "banana/foo" \n\
8
+ import THREE from "three"\n\
9
+ import "foo"\n\
10
+ import("foo" )\n\
11
+ import( "foo" )\n\
12
+ import ( "foo" )\n\
13
+ import ("foo" )\n\
14
+ import ( "foo" )\n\
15
+ ' ;
16
+
17
+
18
+ const str2 = str . replaceAll ( / i m p o r t ( [ ^ \( ] ? \s + [ ^ \( ] ? .* f r o m \s + | ) [ " ' ] ( (? ! \/ | .\/ | ..\/ ) [ ^ ' " ] * ) [ " ' ] / g, 'import$1"/$2"' )
19
+ console . log ( "out:" , str2 ) ;
20
+
21
+
22
+ const str3 = str . replaceAll ( / i m p o r t ( [ ^ \( ] ? \s + [ ^ \( ] ? .* f r o m \s + | ) [ " ' ] ( (? ! \/ | .\/ | ..\/ ) [ ^ ' " ] * ) [ " ' ] / g, 'import$1"/$2?🔨=' + "(referer)" + '"' )
23
+ console . log ( "out:" , str3 ) ;
You can’t perform that action at this time.
0 commit comments