Skip to content

Commit

Permalink
fix: types
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan committed Oct 2, 2024
1 parent 6ea90ae commit eeb285e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/plugins/sri.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export const pluginSri = (): RsbuildPlugin => ({

const hash = crypto
.createHash(algorithm)
.update(data)
.update(data as unknown as Uint8Array)
.digest()
.toString('base64');
const integrity = `${algorithm}-${hash}`;
Expand Down
6 changes: 4 additions & 2 deletions packages/core/src/server/devServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ export async function createDevServer<
https,
};

let outputFileSystem: Rspack.OutputFileSystem = fs;
// TODO: remove this type assertion after Rspack fix the type definition
let outputFileSystem = fs as Rspack.OutputFileSystem;
let lastStats: Rspack.Stats[];

// should register onDevCompileDone hook before startCompile
Expand Down Expand Up @@ -166,10 +167,11 @@ export async function createDevServer<

await compilerDevMiddleware.init();

// TODO: remove this type assertion after Rspack fix the type definition
outputFileSystem =
(isMultiCompiler(compiler)
? compiler.compilers[0].outputFileSystem
: compiler.outputFileSystem) || fs;
: compiler.outputFileSystem) || (fs as Rspack.OutputFileSystem);

return {
middleware: compilerDevMiddleware.middleware,
Expand Down

0 comments on commit eeb285e

Please sign in to comment.