@@ -4,12 +4,10 @@ import webpack from 'webpack';
44
55const { __dirname } = createEsmUtils ( import . meta) ;
66
7- const globalObject = `
8- typeof globalThis !== 'undefined' ? globalThis
7+ const globalObject = `typeof globalThis !== 'undefined' ? globalThis
98 : typeof global !== 'undefined' ? global
109 : typeof self !== 'undefined' ? self
11- : this || {}
12- ` ;
10+ : this || {}` ;
1311
1412// This is the production and development configuration.
1513// It is focused on developer experience, fast rebuilds, and a minimal bundle.
@@ -29,10 +27,8 @@ export default (webpackEnv) => {
2927 // TODO: investigate a cleaner way to populate the global variable
3028 // prettierPlugins in a browser.
3129 new webpack . BannerPlugin ( {
32- banner : `
33- var root = ${ globalObject } ;
34- root["prettierPlugins"] = root["prettierPlugins"] || {}, root["prettierPlugins"]["solidity"] = __webpack_exports__default;
35- ` ,
30+ banner : `var root = ${ globalObject } ;
31+ root["prettierPlugins"] = root["prettierPlugins"] || {}, root["prettierPlugins"]["solidity"] = __webpack_exports__default;` ,
3632 footer : true ,
3733 raw : true
3834 } )
@@ -46,12 +42,6 @@ root["prettierPlugins"] = root["prettierPlugins"] || {}, root["prettierPlugins"]
4642 extensionAlias : { '.js' : [ '.js' , '.ts' ] }
4743 } ,
4844
49- experiments : {
50- asyncWebAssembly : true ,
51- topLevelAwait : true ,
52- outputModule : true
53- } ,
54-
5545 module : {
5646 rules : [
5747 {
@@ -62,6 +52,8 @@ root["prettierPlugins"] = root["prettierPlugins"] || {}, root["prettierPlugins"]
6252 ]
6353 } ,
6454
55+ experiments : { outputModule : true } ,
56+
6557 optimization : { minimize : isEnvProduction } ,
6658 target : [ 'browserslist' ] ,
6759 output : {
0 commit comments