Skip to content

Commit

Permalink
fix(sdk): saveManifest need await when brief mode (#498)
Browse files Browse the repository at this point in the history
  • Loading branch information
easy1090 authored Sep 3, 2024
1 parent 5b5a67c commit bf543ec
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .changeset/stupid-comics-mate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@rsdoctor/webpack-plugin': patch
'@rsdoctor/sdk': patch
---

fix(sdk): saveManifest need await when brief mode
4 changes: 2 additions & 2 deletions packages/sdk/src/sdk/sdk/webpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,15 +373,15 @@ export class RsdoctorWebpackSDK<
}
}

public writeStore(options?: SDK.WriteStoreOptionsType) {
public async writeStore(options?: SDK.WriteStoreOptionsType) {
debug(() => `sdk.writeStore has run.`, '[SDK.writeStore][end]');
if (this.extraConfig?.mode === SDK.IMode[SDK.IMode.brief]) {
const clientHtmlPath = this.extraConfig.innerClientPath
? this.extraConfig.innerClientPath
: require.resolve('@rsdoctor/client');

if (this.extraConfig.brief?.writeDataJson) {
this.saveManifest(this.getStoreData(), options || {});
await this.saveManifest(this.getStoreData(), options || {});
}
return this.inlineScriptsAndStyles(clientHtmlPath);
}
Expand Down
4 changes: 3 additions & 1 deletion packages/webpack-plugin/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ export class RsdoctorWebpackPlugin<Rules extends Linter.ExtendRuleData[]>
);
openBrowser(`file:///${outputFilePath}`);
}
} catch (e) {}
} catch (e) {
console.error(`[Rsdoctor] Webpack plugin this.done error`, e);
}
};
}

0 comments on commit bf543ec

Please sign in to comment.