noc-book-2/gatsby-node.js
2023-02-26 11:04:37 -05:00

20 lines
603 B
JavaScript

const fs = require('fs-extra');
const express = require(`express`);
exports.onCreateNode = require('./gatsby/on-create-node.js');
exports.createPages = require('./gatsby/create-pages.js');
exports.createResolvers = require('./gatsby/create-resolvers.js');
// Enable development support for serving HTML from `./static` folder
exports.onCreateDevServer = ({ app }) => {
app.use(express.static(`content`));
};
// Copy examples to the public folder
exports.onPostBuild = async () => {
try {
await fs.copy('content/examples', 'public/examples/');
} catch (err) {
console.error(err);
}
};