@@ -59,19 +59,21 @@ const wrapIIFEInStringPlugin = {
59
59
result . outputFiles . forEach ( ( outputFile ) => {
60
60
let content = outputFile . text ;
61
61
62
- // IMPORTANT: if minify is disabled, we need to:
63
- // 1. remove var import_ethers = __require("ethers");
64
- // 2. remove import_ethers.
65
- content = content
66
- . replace ( / v a r i m p o r t _ e t h e r s = _ _ r e q u i r e \( " e t h e r s " \) ; / g, "" )
67
- . replace ( / i m p o r t _ e t h e r s \. / g, "" ) ;
68
-
69
- // IMPORTANT: if minify is enabled, we need to:
70
- // 1. remove var t=o(\"ethers\");
71
- // 2. replace t.ethers to ethers
72
- content = content
73
- . replace ( / v a r \s + \w + = \w + \( " e t h e r s " \) ; / g, '' )
74
- . replace ( / [ a - z A - Z ] \. e t h e r s / g, "ethers" ) ;
62
+ // Leaving this in for now, but not needed if we find a better
63
+ // solution for the global ethers object.
64
+ // // IMPORTANT: if minify is disabled, we need to:
65
+ // // 1. remove var import_ethers = __require("ethers");
66
+ // // 2. remove import_ethers.
67
+ // content = content
68
+ // .replace(/var import_ethers = __require\("ethers"\);/g, "")
69
+ // .replace(/import_ethers\./g, "");
70
+
71
+ // // IMPORTANT: if minify is enabled, we need to:
72
+ // // 1. remove var t=o(\"ethers\");
73
+ // // 2. replace t.ethers to ethers
74
+ // content = content
75
+ // .replace(/var\s+\w+=\w+\("ethers"\);/g, '')
76
+ // .replace(/[a-zA-Z]\.ethers/g, "ethers");
75
77
76
78
// Use JSON.stringify to safely encode the content
77
79
const wrappedContent = `/**
0 commit comments