fix the messages showing build progress
This commit is contained in:
parent
9690372b01
commit
b58ec951ba
2 changed files with 6 additions and 3 deletions
7
build.js
7
build.js
|
@ -70,7 +70,11 @@ const findAllPages = async (directory) =>
|
|||
)
|
||||
.map(f => directory + "/" + f); // TODO: hack
|
||||
|
||||
const buildPage = async (pagePath) => await processPageOutput(require(pagePath));
|
||||
const buildPage = async (pagePath) => {
|
||||
const processed = await processPageOutput(require(pagePath));
|
||||
console.log(`${escapeCodes.fgGreen}${specialCharacter("→")}${escapeCodes.reset} Built ${escapeCodes.fgBlue}${path.parse(path.basename(pagePath, buildConfig.pageExtension)).name}${escapeCodes.reset}`);
|
||||
return processed
|
||||
};
|
||||
|
||||
const buildAllPages = async (directory) =>
|
||||
await Promise.all((await findAllPages(directory))
|
||||
|
@ -83,7 +87,6 @@ const exportAllPages = async (sourcePath, outputPath) => {
|
|||
for (const [pagePath, pageContent] of pages) {
|
||||
const pageName = path.parse(path.basename(pagePath, buildConfig.pageExtension)).name;
|
||||
await fs.writeFile(path.join(outputPath, pageName + ".html"), pageContent);
|
||||
console.log(`${escapeCodes.fgGreen}${specialCharacter("→")}${escapeCodes.reset} Built ${escapeCodes.fgBlue}${pageName}${escapeCodes.reset}`);
|
||||
}
|
||||
return pages.length;
|
||||
};
|
||||
|
|
|
@ -3,7 +3,7 @@ module.exports = {
|
|||
outputDirectory: "./out",
|
||||
pageExtension: ".page.js",
|
||||
postProcessing: {
|
||||
trimOutput: false, // not very useful when beautifyOutput === true
|
||||
trimOutput: false,
|
||||
beautifyOutput: true,
|
||||
beautifyOutputOptions: {
|
||||
indent_size: 2,
|
||||
|
|
Loading…
Reference in a new issue