fix(build): modernize package configuration and remove smartfile dependency from filesystem operations
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user