Files
30-seconds-of-code/node_modules/gatsby/dist/internal-plugins/prod-404/gatsby-node.js
2019-08-20 15:52:05 +02:00

20 lines
455 B
JavaScript

"use strict";
let created404 = false;
exports.onCreatePage = ({
page,
store,
actions
}) => {
// Copy /404/ to /404.html as many static site hosts expect
// site 404 pages to be named this.
// https://www.gatsbyjs.org/docs/add-404-page/
if (!created404 && /^\/?404\/?$/.test(page.path)) {
actions.createPage(Object.assign({}, page, {
path: `/404.html`
}));
created404 = true;
}
};
//# sourceMappingURL=gatsby-node.js.map