Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(es/minifier): Fix top-level check (#8583)
**Description:** Our logic for checking top-level was wrong.
- Loading branch information
Showing
15 changed files
with
120 additions
and
126 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
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
4 changes: 1 addition & 3 deletions
4
...cma_minifier/tests/fixture/projects/wmr/archive-1/chunks/alias-outside.6e8773c7/output.js
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 |
---|---|---|
@@ -1,6 +1,4 @@ | ||
import { m } from "../index.f66dda46.js"; | ||
const value$1 = "it works", value = "it works"; | ||
function AliasOutside() { | ||
export default function() { | ||
return m`<div><p>Inside: ${"it works"}</p><p>Outside: ${"it works"}</p></div>`; | ||
} | ||
export default AliasOutside; |
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
3 changes: 1 addition & 2 deletions
3
...es/swc_ecma_minifier/tests/fixture/projects/wmr/archive-1/chunks/index.5a544c41/output.js
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import { m } from "../index.f66dda46.js"; | ||
const jpg = "/assets/img.2dae108d.jpg"; | ||
function Files() { | ||
export default function() { | ||
return m`<div style="padding: 2rem;"><h1>Files</h1><p> jpg: ${jpg}<br/><img src=${jpg} alt="" height="320"/></p></div>`; | ||
} | ||
export default Files; |
5 changes: 2 additions & 3 deletions
5
...es/swc_ecma_minifier/tests/fixture/projects/wmr/archive-1/chunks/index.bf24abaa/output.js
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
8 changes: 2 additions & 6 deletions
8
...es/swc_ecma_minifier/tests/fixture/projects/wmr/archive-1/chunks/index.ddc4110d/output.js
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 |
---|---|---|
@@ -1,10 +1,6 @@ | ||
import { s as style, y, m } from "../index.f66dda46.js"; | ||
const styles = { | ||
about: "about_migxty" | ||
}; | ||
function About({ query, title }) { | ||
import { y, m } from "../index.f66dda46.js"; | ||
export default function({ query, title }) { | ||
return y(()=>(console.log("Mounted About: ", title), ()=>{ | ||
console.log("Unmounting About: ", title); | ||
}), []), m`<section class=${"about_migxty"}><h1>${title || "About"}</h1><p>My name is Jason.</p><pre>${JSON.stringify(query)}</pre></section>`; | ||
} | ||
export default About; |
5 changes: 1 addition & 4 deletions
5
...wc_ecma_minifier/tests/fixture/projects/wmr/archive-1/chunks/prerender.93c6f601/output.js
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
9 changes: 3 additions & 6 deletions
9
crates/swc_ecma_minifier/tests/terser/compress/drop_unused/issue_t161_top_retain_1/output.js
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 |
---|---|---|
@@ -1,9 +1,6 @@ | ||
function f() { | ||
return 2; | ||
} | ||
console.log( | ||
f(), | ||
(function () { | ||
return 3; | ||
})() | ||
); | ||
console.log(f(), function() { | ||
return 3; | ||
}()); |
Oops, something went wrong.