1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00
market/gatsby-node.js

36 lines
903 B
JavaScript
Raw Normal View History

2020-07-17 14:59:20 +02:00
const createFields = require('./gatsby/createFields')
const createMarkdownPages = require('./gatsby/createMarkdownPages')
exports.onCreateNode = ({ node, actions, getNode }) => {
createFields(node, actions, getNode)
}
exports.createPages = async ({ graphql, actions }) => {
await createMarkdownPages(graphql, actions)
2020-06-30 13:32:16 +02:00
}
2020-07-07 10:26:38 +02:00
exports.onCreatePage = async ({ page, actions }) => {
const { createPage } = actions
// page.matchPath is a special key that's used for matching pages
// only on the client.
const handleClientSideOnly = page.path.match(/^\/asset/)
2020-07-07 10:26:38 +02:00
if (handleClientSideOnly) {
page.matchPath = '/asset/*'
2020-07-07 10:26:38 +02:00
// Update the page.
createPage(page)
}
}
2020-07-17 14:59:20 +02:00
exports.onCreateWebpackConfig = ({ actions }) => {
actions.setWebpackConfig({
node: {
// 'fs' fix for squid.js
fs: 'empty'
},
// fix for 'got'/'swarm-js' dependency
externals: ['got']
})
}