File tree 3 files changed +27
-11
lines changed
3 files changed +27
-11
lines changed Original file line number Diff line number Diff line change @@ -327,12 +327,18 @@ let lambda_as_module
327
327
if ! Warnings. has_warnings then begin
328
328
Warnings. has_warnings := false ;
329
329
330
- # 322 " core/lam_compile_main.pp.ml"
331
- if Sys. file_exists target_file then begin
332
- Bs_hash_stubs. set_as_old_file target_file
330
+ # 321 " core/lam_compile_main.pp.ml"
331
+ (* 5206: When there were warnings found during the compilation, we want the file
332
+ to be rebuilt on the next "rescript build" so that the warnings keep being shown.
333
+ Set the timestamp of the ast file to 1970-01-01 to make this rebuild happen.
334
+ (Do *not* set the timestamp of the JS output file instead
335
+ as that does not play well with every bundler.) *)
336
+ let ast_file = output_prefix ^ Literals. suffix_ast in
337
+ if Sys. file_exists ast_file then begin
338
+ Bs_hash_stubs. set_as_old_file ast_file
333
339
end
334
340
335
- # 326 " core/lam_compile_main.pp.ml"
341
+ # 331 " core/lam_compile_main.pp.ml"
336
342
end
337
343
)
338
344
Original file line number Diff line number Diff line change @@ -317,10 +317,15 @@ let lambda_as_module
317
317
target_file output_chan );
318
318
if ! Warnings. has_warnings then begin
319
319
Warnings. has_warnings := false ;
320
- #ifdef BROWSER
321
- #else
322
- if Sys. file_exists target_file then begin
323
- Bs_hash_stubs. set_as_old_file target_file
320
+ #ifndef BROWSER
321
+ (* 5206: When there were warnings found during the compilation, we want the file
322
+ to be rebuilt on the next "rescript build" so that the warnings keep being shown.
323
+ Set the timestamp of the ast file to 1970-01-01 to make this rebuild happen.
324
+ (Do *not* set the timestamp of the JS output file instead
325
+ as that does not play well with every bundler.) *)
326
+ let ast_file = output_prefix ^ Literals. suffix_ast in
327
+ if Sys. file_exists ast_file then begin
328
+ Bs_hash_stubs. set_as_old_file ast_file
324
329
end
325
330
#endif
326
331
end
Original file line number Diff line number Diff line change @@ -274502,9 +274502,14 @@ let lambda_as_module
274502
274502
target_file output_chan );
274503
274503
if !Warnings.has_warnings then begin
274504
274504
Warnings.has_warnings := false ;
274505
-
274506
- if Sys.file_exists target_file then begin
274507
- Bs_hash_stubs.set_as_old_file target_file
274505
+ (* 5206: When there were warnings found during the compilation, we want the file
274506
+ to be rebuilt on the next "rescript build" so that the warnings keep being shown.
274507
+ Set the timestamp of the ast file to 1970-01-01 to make this rebuild happen.
274508
+ (Do *not* set the timestamp of the JS output file instead
274509
+ as that does not play well with every bundler.) *)
274510
+ let ast_file = output_prefix ^ Literals.suffix_ast in
274511
+ if Sys.file_exists ast_file then begin
274512
+ Bs_hash_stubs.set_as_old_file ast_file
274508
274513
end
274509
274514
274510
274515
end
You can’t perform that action at this time.
0 commit comments