Skip to content

Commit 72e2452

Browse files
committed
Fix another type error
1 parent a5fc667 commit 72e2452

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

packages/snaps-cli/src/commands/watch/implementation.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { assert } from '@metamask/utils';
12
import { basename } from 'path';
23
import type { Watching } from 'webpack';
34

@@ -39,6 +40,11 @@ export async function watch(
3940
return;
4041
}
4142

43+
assert(
44+
compiler.watching,
45+
'Expected `compiler.watching` to be defined.',
46+
);
47+
4248
resolve(compiler.watching);
4349
},
4450
);

packages/snaps-cli/src/webpack/plugins.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import type { Ora } from 'ora';
55
import type {
66
Compiler,
77
ProvidePlugin,
8-
ResolvePluginInstance,
98
Resolver,
109
StatsError,
1110
WebpackPluginInstance,
@@ -231,6 +230,13 @@ export class SnapsWatchPlugin implements WebpackPluginInstance {
231230
}
232231
}
233232

233+
/**
234+
* Webpack's resolver plugin interface, which is not exported by Webpack.
235+
*/
236+
type ResolverPlugin = {
237+
apply: (resolver: Resolver) => void;
238+
};
239+
234240
/**
235241
* The options for the {@link SnapsBuiltInResolver}.
236242
*/
@@ -247,7 +253,7 @@ export type SnapsBuiltInResolverOptions = {
247253
* plugin is used to warn the user when they try to import a built-in module,
248254
* when no fallback is configured.
249255
*/
250-
export class SnapsBuiltInResolver implements ResolvePluginInstance {
256+
export class SnapsBuiltInResolver implements ResolverPlugin {
251257
/**
252258
* The built-in modules that have been imported, but not resolved.
253259
*/

0 commit comments

Comments
 (0)