@@ -13,14 +13,8 @@ export default (webpackEnv) => {
1313
1414 // Avoid bundling Prettier
1515 externals : {
16- prettier : {
17- // use 'prettier/standalone' in case the project importing this file is
18- // bundling for the browser.
19- amd : 'prettier/standalone' ,
20- commonjs : 'prettier/standalone' ,
21- commonjs2 : 'prettier/standalone' ,
22- root : 'prettier' // global variable if it was loaded by the browser
23- }
16+ prettier : 'prettier/standalone' ,
17+ 'fs/promises' : 'fs/promises'
2418 } ,
2519
2620 mode : isEnvProduction ? 'production' : 'development' ,
@@ -29,17 +23,12 @@ export default (webpackEnv) => {
2923
3024 resolve : {
3125 extensions : [ '.ts' , '.js' ] ,
32- extensionAlias : {
33- '.js' : [ '.js' , '.ts' ]
34- } ,
35- fallback : {
36- fs : false
37- }
26+ extensionAlias : { '.js' : [ '.js' , '.ts' ] }
3827 } ,
3928
4029 experiments : {
4130 asyncWebAssembly : true ,
42- syncWebAssembly : true
31+ outputModule : true
4332 } ,
4433
4534 module : {
@@ -52,30 +41,14 @@ export default (webpackEnv) => {
5241 ]
5342 } ,
5443
55- optimization : {
56- minimize : isEnvProduction
57- } ,
44+ optimization : { minimize : isEnvProduction } ,
5845 target : [ 'browserslist' ] ,
5946 output : {
6047 chunkFormat : false ,
61- publicPath : '' ,
6248 path : path . resolve ( __dirname , 'dist' ) ,
63- filename : 'standalone.cjs ' ,
49+ filename : 'standalone.js ' ,
6450 clean : true ,
65- globalObject : `
66- typeof globalThis !== 'undefined' ? globalThis
67- : typeof global !== 'undefined' ? global
68- : typeof self !== 'undefined' ? self
69- : this || {}
70- ` ,
71- library : {
72- export : 'default' ,
73- name : {
74- commonjs : 'prettierPluginSolidity' ,
75- root : [ 'prettierPlugins' , 'solidity' ]
76- } ,
77- type : 'umd2'
78- }
51+ library : { export : 'default' , type : 'module' }
7952 } ,
8053 performance : {
8154 maxEntrypointSize : 1024 * 1024 ,
0 commit comments