-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove this
exports tracking for files with module syntax
#9330
Changes from all commits
3843469
993fc0a
7103543
4ab7e55
dddfd19
508b74d
c9647a5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -252,6 +252,7 @@ pub fn transform(config: Config) -> Result<TransformResult, std::io::Error> { | |
), | ||
)); | ||
|
||
let is_module = module.is_module(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does this do exactly? What is the definition of a "module" here? Anything with an import/export? We also compute this within There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Looks like yes https://github.com/swc-project/swc/blob/a18ffc107f779d2fb576d610af65315e460efbd1/crates/swc_ecma_parser/src/parser/mod.rs#L162 |
||
// If it's a script, convert into module. This needs to happen after | ||
// the resolver (which behaves differently for non-/strict mode). | ||
let module = match module { | ||
|
@@ -342,6 +343,7 @@ pub fn transform(config: Config) -> Result<TransformResult, std::io::Error> { | |
global_mark, | ||
&config.project_root, | ||
&mut fs_deps, | ||
is_module | ||
), | ||
should_inline_fs | ||
), | ||
|
@@ -448,6 +450,7 @@ pub fn transform(config: Config) -> Result<TransformResult, std::io::Error> { | |
ignore_mark, | ||
global_mark, | ||
config.trace_bailouts, | ||
is_module, | ||
); | ||
module.visit_with(&mut collect); | ||
if let Some(bailouts) = &collect.bailouts { | ||
|
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.
I updated this to closer reflect the parsing we do in
lib.rs