Hi! I'm trying to replace ts-loader with swc-loader in my app to speed up building. And I found that the replacement cause unexpected result in code execution order. Here's the reproduction repository: https://github.com/JerryChan31/swc-loader-context
Reproduction steps:
run pnpm install on branch main.
run git checkout ts-loader
run npm run reproduce
run git checkout swc-loader
run npm run reproduce
And you can see the output of the first npm run reproduce is:
a.js entry
d.js constructor
d.js init
a.js before B
B.js exec
and the second one:
d.js constructor
a.js entry
d.js init
a.js before B
B.js exec
It would be grateful to know what cause the difference. Thank you!
Problem context
Hi! I'm trying to replace
ts-loader
withswc-loader
in my app to speed up building. And I found that the replacement cause unexpected result in code execution order. Here's the reproduction repository: https://github.com/JerryChan31/swc-loader-contextReproduction steps:
pnpm install
on branchmain
.git checkout ts-loader
npm run reproduce
git checkout swc-loader
npm run reproduce
And you can see the output of the first
npm run reproduce
is:and the second one:
It would be grateful to know what cause the difference. Thank you!