2022-08-08 21:56:08 +02:00
|
|
|
const fs = require('fs-extra');
|
|
|
|
const express = require(`express`);
|
|
|
|
|
2022-07-26 21:25:53 +02:00
|
|
|
exports.onCreateNode = require('./gatsby/on-create-node.js');
|
|
|
|
exports.createPages = require('./gatsby/create-pages.js');
|
2022-07-29 03:29:28 +02:00
|
|
|
exports.createResolvers = require('./gatsby/create-resolvers.js');
|
2022-08-08 21:56:08 +02:00
|
|
|
|
|
|
|
// Enable development support for serving HTML from `./static` folder
|
|
|
|
exports.onCreateDevServer = ({ app }) => {
|
|
|
|
app.use(express.static(`content`));
|
|
|
|
};
|
|
|
|
|
|
|
|
// Copy examples to the public folder
|
2023-02-26 17:04:37 +01:00
|
|
|
exports.onPostBuild = async () => {
|
|
|
|
try {
|
|
|
|
await fs.copy('content/examples', 'public/examples/');
|
|
|
|
} catch (err) {
|
|
|
|
console.error(err);
|
|
|
|
}
|
2022-08-08 21:56:08 +02:00
|
|
|
};
|