And if I run it, it logs { c: [Function: c], a: [Function: a], b: [Function: b] }.
If I use vite-plugin-solid AND the file is a .tsx, the build result is the following:
And it outputs { c: [Function: c], b: [Function: b] } when ran.
Why does "A.a" gets removed from the namespace?
Moreover, why does changing the code like this works?
namespace B {
export function c() { }
}
export namespace A {
export function a() { }
export function b() { }
export const { c } = B; // ← Moved on the bottom of the namespace
}
console.log(A);
I have a file containing the following code:
When building it with vite it gets turned to this:
And if I run it, it logs
{ c: [Function: c], a: [Function: a], b: [Function: b] }
. If I usevite-plugin-solid
AND the file is a.tsx
, the build result is the following:And it outputs
{ c: [Function: c], b: [Function: b] }
when ran. Why does "A.a" gets removed from the namespace? Moreover, why does changing the code like this works?