Conversation
| return; | ||
| } | ||
|
|
||
| // @ts-ignore sourceMap in the webpack doesn't have the type RawSourceMap |
There was a problem hiding this comment.
Seems like the callback(null, ${content}\n${FOOTER}${exportsCode}, sourceMap); takes type def SourceMap that is not exported from webpack. Should we export that and consume it here?
There was a problem hiding this comment.
Weird, it is interface with the same methods...
There was a problem hiding this comment.
This is in webpack
declare interface SourceMap {
version: number;
sources: string[];
mappings: string;
file?: string;
sourceRoot?: string;
sourcesContent?: string[];
names?: string[];
}This is in source-map
export interface RawSourceMap extends StartOfSourceMap {
version: string;
sources: string[];
names: string[];
sourcesContent?: string[];
mappings: string;
}There was a problem hiding this comment.
We should investigate it, maybe add better types, because ignore is not good idea for types, looks like problem in version, we can improve it
There was a problem hiding this comment.
which version are you mentioning? webpack? It is in its latest version. I hope the source-map is in latest version as well?
There was a problem hiding this comment.
What if we export the SourceMap from webpack and consume it? Is it not recommended
There was a problem hiding this comment.
I think webpack have own types for source maps due to this we have problems with types
This PR contains a:
Motivation / Use-Case
Tried to add type definitions to the loader using jsdocs
Breaking Changes
Adds type defs
Additional Info
Need inputs on how to move forward with this.