Skip to content

Commit 27a93e3

Browse files
committed
fix: Use other type of import for NullDependency
It looks like the other type can fail after compiled to JS.
1 parent a658945 commit 27a93e3

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/dependency.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ import * as webpack from "webpack";
55
// @ts-ignore: What's the right way to refer to this one?
66
import makeSerializable from "webpack/lib/util/makeSerializable.js";
77

8-
class DocGenDependency extends webpack.dependencies.NullDependency {
8+
// eslint-disable-next-line
9+
// @ts-ignore: What's the right way to refer to this one?
10+
import NullDependency from "webpack/lib/dependencies/NullDependency.js";
11+
12+
class DocGenDependency extends NullDependency {
913
public codeBlock: string;
1014

1115
constructor(codeBlock: string) {
@@ -27,7 +31,7 @@ makeSerializable(
2731
type NullDependencyTemplateType = InstanceType<
2832
typeof webpack.dependencies.NullDependency.Template
2933
>;
30-
class DocGenTemplate extends webpack.dependencies.NullDependency.Template
34+
class DocGenTemplate extends NullDependency.Template
3135
implements NullDependencyTemplateType {
3236
// eslint-disable-next-line
3337
// @ts-ignore: Webpack 4 type
@@ -42,6 +46,7 @@ class DocGenTemplate extends webpack.dependencies.NullDependency.Template
4246
};
4347
}
4448

49+
// @ts-ignore TODO: How to type this correctly?
4550
DocGenDependency.Template = DocGenTemplate;
4651

4752
// Default imports are tricky with CommonJS

0 commit comments

Comments
 (0)