-
Notifications
You must be signed in to change notification settings - Fork 7
/
postBuild.js
35 lines (33 loc) · 1.01 KB
/
postBuild.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const fs = require('fs/promises');
async function postProssess(){
console.log("running post processing");
const err = await fs.mkdir('./site_dist/.well-known/');
if(err){
console.log("error")
}
const stellarContent = `
# Federation service provided by StellarID.io
FEDERATION_SERVER="https://stellarid.io/federation/"
`
await fs.writeFile('./site_dist/.well-known/stellar.toml', stellarContent);
netlifyContent = `
[[headers]]
# Define which paths this specific [[headers]] block will cover.
for = "/.well-known/*"
[headers.values]
Access-Control-Allow-Origin = "*"
`;
await fs.writeFile('./site_dist/netlify.toml', netlifyContent);
await fs.cp('./docs', './site_dist/docs', { recursive: true }, (err) => {
if (err) {
console.error(err);
}
});
await fs.cp('./faq', './site_dist/faq', { recursive: true }, (err) => {
if (err) {
console.error(err);
}
});
console.log("post processing complete");
}
postProssess()