File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -435,12 +435,9 @@ type WildFullsec = Record<string, () => ScriptFailure> & {
435435export async function processScript ( script : string ) {
436436 const autocompleteMatch = script . match ( / ^ (?: \/ \/ @ a u t o c o m p l e t e ( .+ ) | f u n c t i o n (?: \w + | ) ? \( [ ^ \) ] * \) \s * { \s * \/ \/ ( .+ ) ) \n / )
437437
438- if ( script . startsWith ( "export function" ) )
439- script = script . replace ( "export " , "" )
440-
441438 script = script
442439 . replace ( / [ # \$ ] ( [ \w . ] + \( ) / g, a => "$" + a . slice ( 1 ) . replace ( / \. / g, "$" ) )
443- . replace ( / ^ f u n c t i o n \s * \( / , "function script(" )
440+ . replace ( / f u n c t i o n \s * \( / , "function script(" )
444441 . replace ( / # G [ ^ \w ] / g, "$G" )
445442
446443 // compilation
@@ -451,6 +448,8 @@ export async function processScript(script: string) {
451448 }
452449 } ) . outputText
453450
451+ script = script . replace ( / ^ e x p o r t / , "" )
452+
454453 // minification
455454 script = ( await minify ( script , { compress : {
456455 keep_fargs : false ,
You can’t perform that action at this time.
0 commit comments