Skip to content

🎥 Make videos programmatically with React

fast refresh

Jonny Burger30a9dda68e06
diff --git a/packages/bundler/src/case-sensitive-paths.ts b/packages/bundler/src/case-sensitive-paths.ts
index 01f0d989f4..427414005a 100644
--- a/packages/bundler/src/case-sensitive-paths.ts
+++ b/packages/bundler/src/case-sensitive-paths.ts
@@ -1,5 +1,5 @@
import path from 'path';
-import type {Compiler} from 'webpack';
+import type {Compiler, InputFileSystem} from 'webpack';
// Inlined from https://github.com/umijs/case-sensitive-paths-webpack-plugin/blob/master/src/index.ts
@@ -74,7 +74,7 @@ export class CaseSensitivePathsPlugin {
} else {
// read directory for the first time
deferrer = new Promise((resolve2) => {
- this.fs.readdir(dir, (_, files = []) => {
+ (this.fs as InputFileSystem).readdir(dir, (_, files = []) => {
// save cache, resolve promise and release deferrer
this.cacheMap.set(dir, files as string[]);
resolve2(files as string[]);
diff --git a/packages/bundler/src/fast-refresh/index.ts b/packages/bundler/src/fast-refresh/index.ts
index e6bd3d7e54..d54c383d87 100644
--- a/packages/bundler/src/fast-refresh/index.ts
+++ b/packages/bundler/src/fast-refresh/index.ts
@@ -32,6 +32,7 @@
// https://github.com/vercel/next.js/blob/canary/packages/react-refresh-utils/ReactRefreshWebpackPlugin.ts
import type webpack from 'webpack';
+import type {Compilation} from 'webpack';
import {RuntimeGlobals, RuntimeModule, Template, version} from 'webpack';
class ReactRefreshRuntimeModule extends RuntimeModule {
@@ -40,7 +41,7 @@ class ReactRefreshRuntimeModule extends RuntimeModule {
}
generate() {
- const {runtimeTemplate} = this.compilation;
+ const {runtimeTemplate} = this.compilation as Compilation;
return Template.asString([
`${
RuntimeGlobals.interceptModuleExecution