mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 15:47:23 +02:00
Update CNAME file generation
This commit is contained in:
parent
3c2b585a60
commit
c0792044b2
1 changed files with 4 additions and 11 deletions
|
@ -386,17 +386,10 @@ function execute() {
|
|||
}
|
||||
});
|
||||
|
||||
/* Generate CNAME file if the domain is custom */
|
||||
if (!siteConfig.url.includes("github.io")) { // github.io urls are not custom
|
||||
let cname = siteConfig.url;
|
||||
let targetFile =
|
||||
__dirname +
|
||||
"/../../build" +
|
||||
"/" +
|
||||
siteConfig.projectName +
|
||||
"/" +
|
||||
"CNAME";
|
||||
fs.writeFileSync(targetFile, cname);
|
||||
/* Generate CNAME file if a custom domain is specified in siteConfig */
|
||||
if (siteConfig.cname) {
|
||||
let targetFile = CWD + "/build/" + siteConfig.projectName + "/CNAME";
|
||||
fs.writeFileSync(targetFile, siteConfig.cname);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue