Poor webpack own typings detalization
See original GitHub issueBug report
What is the current behavior?
Loader from webpack/declarations/WebpackOptions
export interface Loader {
[k: string]: any;
}
Loader from @types/webpack
interface Loader extends Function {
(this: LoaderContext, source: string | Buffer, sourceMap?: RawSourceMap): string | Buffer | void | undefined;
/**
* The order of chained loaders are always called from right to left.
* But, in some cases, loaders do not care about the results of the previous loader or the resource.
* They only care for metadata. The pitch method on the loaders is called from left to right before the loaders are called (from right to left).
* If a loader delivers a result in the pitch method the process turns around and skips the remaining loaders,
* continuing with the calls to the more left loaders. data can be passed between pitch and normal call.
*/
pitch?(remainingRequest: string, precedingRequest: string, data: any): any;
/**
* By default, the resource file is treated as utf-8 string and passed as String to the loader.
* By setting raw to true the loader is passed the raw Buffer.
* Every loader is allowed to deliver its result as String or as Buffer.
* The compiler converts them between loaders.
*/
raw?: boolean;
}
Quite big difference)
As I understand, own types are not so detailed, as in @types/webpack But It will be nice to have the same typings with the same detalization.
Other relevant information: webpack version: beta 15 Node.js version: 10.xxx Operating System: windows
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Custom typing definitions file is ignored after Upgrade to ...
I've got the same issue when I migrate to Angular 9. I fix it just adding typings.d.ts in your tsconfig.app.json { "extends": "....
Read more >webpack-typings-aliases-plugin - npm package - Snyk
webpack -typings-aliases-plugin. v0.0.10. Resolves typings aliases for typescript For more information about how to use this package see README.
Read more >Using webpack with TypeScript - LogRocket Blog
Learn how to use webpack to compile TypeScript to JavaScript and bundle source code into a single JavaScript file.
Read more >The Right Usage of Aliases in Webpack and TypeScript
Today I want to share some tips with you to improve your projects and make it much easier to maintain. I'm talking about...
Read more >Using Typescript - WorkAdventure
Below is a step by step guide explaining how to set up Typescript + Webpack along your WorkAdventure map. In your map directory,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

There is a temp solution, who want to use webpack beta 15 and rich typings from @types/webpack: tsconfig.json
Let’s close in favor https://github.com/webpack/webpack/issues/11630, we need some more types for loader(s)