File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -907,6 +907,7 @@ const applyOutputDefaults = (
907
907
D ( output , "strictModuleExceptionHandling" , false ) ;
908
908
909
909
const optimistic = v => v || v === undefined ;
910
+ const conditionallyOptimistic = ( v , c ) => ( v === undefined && c ) || v ;
910
911
F (
911
912
output . environment ,
912
913
"arrowFunction" ,
@@ -921,7 +922,11 @@ const applyOutputDefaults = (
921
922
F ( output . environment , "forOf" , ( ) => tp && optimistic ( tp . forOf ) ) ;
922
923
F ( output . environment , "bigIntLiteral" , ( ) => tp && tp . bigIntLiteral ) ;
923
924
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
+ ) ;
925
930
926
931
const { trustedTypes } = output ;
927
932
if ( trustedTypes ) {
Original file line number Diff line number Diff line change @@ -882,6 +882,9 @@ describe("Defaults", () => {
882
882
- "chunkFilename": "[name].js",
883
883
+ "chunkFilename": "[name].mjs",
884
884
@@ ... @@
885
+ - "module": undefined,
886
+ + "module": true,
887
+ @@ ... @@
885
888
- "filename": "[name].js",
886
889
+ "filename": "[name].mjs",
887
890
@@ ... @@
You can’t perform that action at this time.
0 commit comments