Skip to content

JerryChan31/swc-loader-context

Repository files navigation

Problem context

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:

  1. run pnpm install on branch main.
  2. run git checkout ts-loader
  3. run npm run reproduce
  4. run git checkout swc-loader
  5. 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

the code difference between those branches is:

-        loader: "swc-loader",
+        loader: "ts-loader",
         exclude: ["/node_modules/"],
+        options: {
+          transpileOnly: true
+        }

It would be grateful to know what cause the difference. Thank you!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published