fix(build): modernize package configuration and remove smartfile dependency from filesystem operations

This commit is contained in:
2026-05-01 16:40:11 +00:00
parent 27fd2efb51
commit 61218599c8
12 changed files with 4044 additions and 5807 deletions
+5 -6
View File
@@ -29,7 +29,7 @@ export class SmartSSR {
const browser = new plugins.smartpuppeteer.IncognitoBrowser();
const renderTimeMeasurement = new plugins.smarttime.HrtMeasurement();
let renderedPageString: string;
let screenshotBuffer: Buffer;
let screenshotBuffer: Buffer | undefined;
await browser.start();
try {
const context = await browser.getNewIncognitoContext();
@@ -84,12 +84,11 @@ export class SmartSSR {
// debug
if (this.options.debug) {
plugins.smartfile.memory.toFsSync(
renderedPageString,
plugins.path.join(paths.noGitDir, 'test.html')
);
const fs = await import('fs');
fs.writeFileSync(plugins.path.join(paths.noGitDir, 'test.png'), screenshotBuffer);
fs.writeFileSync(plugins.path.join(paths.noGitDir, 'test.html'), renderedPageString);
if (screenshotBuffer) {
fs.writeFileSync(plugins.path.join(paths.noGitDir, 'test.png'), screenshotBuffer);
}
}
return resultDeferred.promise;