20 lines
704 B
JavaScript
20 lines
704 B
JavaScript
import fs from 'fs';
|
|
import { BasePaths } from './lib/render/base-paths.js';
|
|
import { Renderer } from './lib/render/renderer.js';
|
|
import { FileHelper } from './lib/render/file-helper.js';
|
|
import { SettingsReader } from './lib/render/settings-reader.js';
|
|
import { Context } from './lib/struct/context.js';
|
|
|
|
// Delete prior output, if exists.
|
|
if(fs.existsSync(BasePaths.targetRoot())) {
|
|
fs.rmSync(BasePaths.targetRoot(), { recursive: true, force: true });
|
|
}
|
|
|
|
// fs.mkdirSync(BasePaths.targetRoot());
|
|
|
|
const startPath = '';
|
|
const rootContext = SettingsReader.readDirectorySettings(`${BasePaths.contentRoot()}/${startPath}`);
|
|
|
|
const renderer = new Renderer(startPath, rootContext);
|
|
|
|
renderer.renderAll(); |