File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -907,6 +907,7 @@ const applyOutputDefaults = (
907907 D ( output , "strictModuleExceptionHandling" , false ) ;
908908
909909 const optimistic = v => v || v === undefined ;
910+ const conditionallyOptimistic = ( v , c ) => ( v === undefined && c ) || v ;
910911 F (
911912 output . environment ,
912913 "arrowFunction" ,
@@ -921,7 +922,11 @@ const applyOutputDefaults = (
921922 F ( output . environment , "forOf" , ( ) => tp && optimistic ( tp . forOf ) ) ;
922923 F ( output . environment , "bigIntLiteral" , ( ) => tp && tp . bigIntLiteral ) ;
923924 F ( output . environment , "dynamicImport" , ( ) => tp && tp . dynamicImport ) ;
924- F ( output . environment , "module" , ( ) => tp && tp . module ) ;
925+ F (
926+ output . environment ,
927+ "module" ,
928+ ( ) => tp && conditionallyOptimistic ( tp . module , output . module )
929+ ) ;
925930
926931 const { trustedTypes } = output ;
927932 if ( trustedTypes ) {
Original file line number Diff line number Diff line change @@ -882,6 +882,9 @@ describe("Defaults", () => {
882882 - "chunkFilename": "[name].js",
883883 + "chunkFilename": "[name].mjs",
884884 @@ ... @@
885+ - "module": undefined,
886+ + "module": true,
887+ @@ ... @@
885888 - "filename": "[name].js",
886889 + "filename": "[name].mjs",
887890 @@ ... @@
You can’t perform that action at this time.
0 commit comments