umijs / mako

An extremely fast, production-grade web bundler based on Rust.
https://makojs.dev
MIT License
1.73k stars 64 forks source link

bug: exported `Infinity` function renamed #1418

Open stormslowly opened 1 month ago

stormslowly commented 1 month ago
// index.js
import { Infinity as infi } from "./bug";
infi();
// bug.js
function Infinity() {
  console.log("Inifinity");
}
// Infinity.size = [8];
export { Infinity };
// mako.confg.json
{
  "minify": false,
  "_treeShaking": false,
  "optimization": {
    "skipModules": false,
    "concatenateModules": false
  }
}
cargo mako . && node  dist/index.js
/mako/examples/dead-simple/dist/index.js:30
            (0, _bug.Infinity)();
                              ^

TypeError: (0 , _bug.Infinity) is not a function

expect

Print out "Inifinity"

stormslowly commented 1 month ago

will fixed after https://github.com/swc-project/swc/pull/8471 ( swc_core v0.87.22 ), need upgrade swc