-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(bundler): Ignore
require
of external modules (#2840)
swc_bundler: - Check for external modules for `require` calls`. (Closes #2275)
- Loading branch information
Showing
6 changed files
with
19 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
crates/swc_bundler/tests/fixture/external-require/input/entry.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
var f = require('fs'); | ||
console.log(f); |
2 changes: 2 additions & 0 deletions
2
crates/swc_bundler/tests/fixture/external-require/output/entry.inlined.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
var f = require('fs'); | ||
console.log(f); |
2 changes: 2 additions & 0 deletions
2
crates/swc_bundler/tests/fixture/external-require/output/entry.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
var f = require('fs'); | ||
console.log(f); |
c8de935
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmark
base_tr_fixer
23530
ns/iter (± 312
)35581
ns/iter (± 5688
)0.66
base_tr_resolver_and_hygiene
134667
ns/iter (± 6063
)203378
ns/iter (± 49904
)0.66
codegen_es2015
51424
ns/iter (± 443
)71228
ns/iter (± 12479
)0.72
codegen_es2016
51412
ns/iter (± 425
)70251
ns/iter (± 7207
)0.73
codegen_es2017
51269
ns/iter (± 445
)71341
ns/iter (± 11148
)0.72
codegen_es2018
51406
ns/iter (± 408
)70740
ns/iter (± 10371
)0.73
codegen_es2019
51390
ns/iter (± 419
)71351
ns/iter (± 10574
)0.72
codegen_es2020
51778
ns/iter (± 467
)71596
ns/iter (± 11645
)0.72
codegen_es3
51751
ns/iter (± 758
)69980
ns/iter (± 5504
)0.74
codegen_es5
51398
ns/iter (± 346
)69919
ns/iter (± 6208
)0.74
full_es2015
180495258
ns/iter (± 8806278
)230304038
ns/iter (± 12187965
)0.78
full_es2016
143891553
ns/iter (± 6901884
)182062260
ns/iter (± 11175956
)0.79
full_es2017
155350323
ns/iter (± 8631936
)187889170
ns/iter (± 12497944
)0.83
full_es2018
153646317
ns/iter (± 6672768
)189012774
ns/iter (± 18599292
)0.81
full_es2019
157945835
ns/iter (± 11349004
)230066486
ns/iter (± 52212650
)0.69
full_es2020
154423053
ns/iter (± 7580218
)195235626
ns/iter (± 59072193
)0.79
full_es3
225540446
ns/iter (± 22510667
)273961200
ns/iter (± 174511502
)0.82
full_es5
202349797
ns/iter (± 8948752
)247778411
ns/iter (± 15264748
)0.82
parser
656935
ns/iter (± 22811
)835462
ns/iter (± 110680
)0.79
ser_ast_node
152
ns/iter (± 0
)188
ns/iter (± 34
)0.81
ser_serde
160
ns/iter (± 3
)205
ns/iter (± 31
)0.78
emit_colors
19435226
ns/iter (± 25720781
)15183246
ns/iter (± 21646959
)1.28
emit_large
122357435
ns/iter (± 188613070
)105353546
ns/iter (± 163141172
)1.16
base_clone
2402030
ns/iter (± 118342
)2972174
ns/iter (± 331381
)0.81
fold_span
4198956
ns/iter (± 509088
)5090971
ns/iter (± 832645
)0.82
fold_span_panic
5394560
ns/iter (± 1590989
)5485211
ns/iter (± 1475293
)0.98
visit_mut_span
4345727
ns/iter (± 1070230
)3534278
ns/iter (± 540709
)1.23
visit_mut_span_panic
4405983
ns/iter (± 1432067
)3608942
ns/iter (± 757899
)1.22
ast_clone
16904
ns/iter (± 238
)25849
ns/iter (± 4473
)0.65
ast_clone_to_stable
51315
ns/iter (± 412
)80228
ns/iter (± 8518
)0.64
ast_clone_to_stable_then_to_unstable
92930
ns/iter (± 668
)143086
ns/iter (± 19419
)0.65
json_deserialize
1931129
ns/iter (± 5036
)2786211
ns/iter (± 335181
)0.69
json_serialize
85026
ns/iter (± 421
)121780
ns/iter (± 21770
)0.70
boxing_boxed
144
ns/iter (± 1
)200
ns/iter (± 23
)0.72
boxing_boxed_clone
71
ns/iter (± 0
)89
ns/iter (± 17
)0.80
boxing_unboxed
130
ns/iter (± 0
)174
ns/iter (± 24
)0.75
boxing_unboxed_clone
63
ns/iter (± 0
)84
ns/iter (± 9
)0.75
time_10
331
ns/iter (± 2
)388
ns/iter (± 45
)0.85
time_15
694
ns/iter (± 2
)797
ns/iter (± 84
)0.87
time_20
1274
ns/iter (± 4
)1479
ns/iter (± 126
)0.86
time_40
7103
ns/iter (± 18
)5452
ns/iter (± 442
)1.30
time_5
101
ns/iter (± 1
)126
ns/iter (± 10
)0.80
time_60
16008
ns/iter (± 48
)11488
ns/iter (± 800
)1.39
This comment was automatically generated by workflow using github-action-benchmark.