mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-06 10:20:09 +02:00
fix(v2): should be able to build even if static folder doesnt exist (#1479)
This commit is contained in:
parent
0e5cac94cb
commit
05ba7d835d
1 changed files with 12 additions and 10 deletions
|
@ -92,6 +92,7 @@ module.exports = async function build(siteDir, cliOptions = {}) {
|
||||||
|
|
||||||
// Copy static files.
|
// Copy static files.
|
||||||
const staticDir = path.resolve(siteDir, 'static');
|
const staticDir = path.resolve(siteDir, 'static');
|
||||||
|
if (fs.existsSync(staticDir)) {
|
||||||
const staticFiles = await globby(['**'], {
|
const staticFiles = await globby(['**'], {
|
||||||
cwd: staticDir,
|
cwd: staticDir,
|
||||||
});
|
});
|
||||||
|
@ -102,6 +103,7 @@ module.exports = async function build(siteDir, cliOptions = {}) {
|
||||||
return fs.copy(fromPath, toPath);
|
return fs.copy(fromPath, toPath);
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/* Plugin lifecycle - postBuild */
|
/* Plugin lifecycle - postBuild */
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue