Skip to content

Commit 17b7e4c

Browse files
committed
docs: copy cname after build
1 parent a9b402b commit 17b7e4c

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
leaflet-geosearch.meijer.works

gatsby-node.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
/* eslint-disable @typescript-eslint/no-var-requires */
22
const path = require('path');
3+
const fs = require('fs');
4+
5+
const statics = ['CNAME'];
6+
7+
exports.onPostBuild = ({ reporter }) => {
8+
for (const file of statics) {
9+
const src = path.resolve(process.cwd(), file);
10+
const dest = path.resolve(process.cwd(), '.docz/dist', file);
11+
12+
if (!fs.existsSync(src)) {
13+
reporter.info(`File ${file} not found`);
14+
continue;
15+
}
16+
17+
fs.copyFileSync(src, dest);
18+
reporter.info(`Copied ${src}${dest}`);
19+
}
20+
};
321

422
exports.onCreateWebpackConfig = ({ actions, stage, loaders }) => {
523
if (stage === 'build-html' || stage === 'develop-html') {

0 commit comments

Comments
 (0)