mirror of
https://github.com/swc-project/swc.git
synced 2024-11-28 02:29:04 +03:00
fix(es/minifier): Don't drop unused properties of top-level vars (#7638)
**Related issue:** - Closes #7635.
This commit is contained in:
parent
e80c695c89
commit
19ba714ea1
@ -835,6 +835,10 @@ impl Optimizer<'_> {
|
|||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if self.ctx.top_level && !self.options.top_level() {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
|
||||||
let name = v.name.as_ident()?;
|
let name = v.name.as_ident()?;
|
||||||
let obj = v.init.as_mut()?.as_mut_object()?;
|
let obj = v.init.as_mut()?.as_mut_object()?;
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { s as style, m } from "../index.f66dda46.js";
|
import { s as style, m } from "../index.f66dda46.js";
|
||||||
const process = {
|
const process = {
|
||||||
|
browser: !0,
|
||||||
env: {
|
env: {
|
||||||
FOO: "bar",
|
FOO: "bar",
|
||||||
OVERRIDE: "11",
|
OVERRIDE: "11",
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
import { s as style, y, m } from "../index.f66dda46.js";
|
import { s as style, y, m } from "../index.f66dda46.js";
|
||||||
const styles = {};
|
const styles = {
|
||||||
|
about: "about_migxty"
|
||||||
|
};
|
||||||
function About({ query, title }) {
|
function About({ query, title }) {
|
||||||
return y(()=>(console.log("Mounted About: ", title), ()=>{
|
return y(()=>(console.log("Mounted About: ", title), ()=>{
|
||||||
console.log("Unmounting About: ", title);
|
console.log("Unmounting About: ", title);
|
||||||
|
Loading…
Reference in New Issue
Block a user