Skip to content

Commit

Permalink
fix: use compilation api to get assets
Browse files Browse the repository at this point in the history
  • Loading branch information
ClarkXia committed Dec 26, 2023
1 parent 1cc8326 commit c1deba8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/ice/src/webpack/ServerCompilerPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ export default class ServerCompilerPlugin {
if (compilation) {
// Option of compilationInfo need to be object, while it may changed during multi-time compilation.
this.compilerOptions.compilationInfo.assetsManifest =
JSON.parse(compilation.assets['assets-manifest.json'].source().toString());
JSON.parse(compilation.getAsset('assets-manifest.json').source.source().toString());

if (compilation.assets?.['react-client-manifest.json']) {
if (compilation.getAsset('react-client-manifest.json')) {
// @ts-ignore
this.compilerOptions.compilationInfo.rscManifest =
JSON.parse(compilation.assets['react-client-manifest.json']?.source()?.toString());
JSON.parse(compilation.getAsset('react-client-manifest.json').source.source().toString());
}
}
// For first time, we create a new task.
Expand Down

0 comments on commit c1deba8

Please sign in to comment.