Hey all!
Maintainer of ts-loader here. I'm just writing up the migration of ts-loader to be built / run it's test packs against webpack 5 on my blog: johnnyreilly/blog.johnnyreilly.com#35
One thing that happened as part of the migration was that we started using the TypeScript types that webpack ships with as of v5. This has been great! However, we did find one omission in the form of the LoaderContext which is typed as any:
|
* @returns {any} loader context |
Is this intentional? Or would it be possible for this to become strongly typed in future as well?
Looking at this:
|
Object.assign(loaderContext, options.loader); |
It would seem the type is something like this:
type LoaderContext = typeof loaderContext & typeof options.loader
Related PR: TypeStrong/ts-loader#1251
Hey all!
Maintainer of
ts-loaderhere. I'm just writing up the migration ofts-loaderto be built / run it's test packs against webpack 5 on my blog: johnnyreilly/blog.johnnyreilly.com#35One thing that happened as part of the migration was that we started using the TypeScript types that webpack ships with as of v5. This has been great! However, we did find one omission in the form of the
LoaderContextwhich is typed asany:webpack/lib/NormalModule.js
Line 424 in 03961f3
Is this intentional? Or would it be possible for this to become strongly typed in future as well?
Looking at this:
webpack/lib/NormalModule.js
Line 593 in 03961f3
It would seem the type is something like this:
Related PR: TypeStrong/ts-loader#1251