new-docs
Cory LaViska 2023-06-08 13:47:01 -04:00
rodzic 620b86cddb
commit 0de54b163a
3 zmienionych plików z 2 dodań i 15 usunięć

1
package-lock.json wygenerowano
Wyświetl plik

@ -35,7 +35,6 @@
"cem-plugin-vs-code-custom-data-generator": "^1.4.1",
"chalk": "^5.2.0",
"change-case": "^4.1.2",
"chokidar": "^3.5.3",
"command-line-args": "^5.2.1",
"comment-parser": "^1.3.1",
"cspell": "^6.18.1",

Wyświetl plik

@ -89,7 +89,6 @@
"cem-plugin-vs-code-custom-data-generator": "^1.4.1",
"chalk": "^5.2.0",
"change-case": "^4.1.2",
"chokidar": "^3.5.3",
"command-line-args": "^5.2.1",
"comment-parser": "^1.3.1",
"cspell": "^6.18.1",

Wyświetl plik

@ -3,7 +3,6 @@ import { exec, spawn } from 'child_process';
import { globby } from 'globby';
import browserSync from 'browser-sync';
import chalk from 'chalk';
import chokidar from 'chokidar';
import commandLineArgs from 'command-line-args';
import copy from 'recursive-copy';
import esbuild from 'esbuild';
@ -32,7 +31,6 @@ let buildResult;
async function buildTheDocs(watch = false) {
return new Promise((resolve, reject) => {
const args = ['@11ty/eleventy', '--quiet'];
const watcher = chokidar.watch(sitedir, { persistent: true });
const output = [];
if (watch) {
@ -50,15 +48,8 @@ async function buildTheDocs(watch = false) {
output.push(data.toString());
});
// Spin up Eleventy and wait for the search index to appear before proceeding. The search index is generated during
// eleventy.after, so it appears only after the docs are fully published. This is a hacky way to detect when the
// initial publish is complete, but here we are.
watcher.on('add', async filename => {
if (filename.endsWith('search.json')) {
await watcher.close();
resolve({ child, output });
}
child.on('close', () => {
resolve({ child, output });
});
});
}
@ -273,8 +264,6 @@ if (!serve) {
if (result.output.length > 0) {
console.log('\n' + result.output.join('\n'));
}
process.exit();
}
// Cleanup on exit