mirror of
https://github.com/oceanprotocol/market.git
synced 2024-11-14 17:24:51 +01:00
36 lines
903 B
JavaScript
36 lines
903 B
JavaScript
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)
|
|
}
|
|
|
|
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/)
|
|
|
|
if (handleClientSideOnly) {
|
|
page.matchPath = '/asset/*'
|
|
|
|
// Update the page.
|
|
createPage(page)
|
|
}
|
|
}
|
|
|
|
exports.onCreateWebpackConfig = ({ actions }) => {
|
|
actions.setWebpackConfig({
|
|
node: {
|
|
// 'fs' fix for squid.js
|
|
fs: 'empty'
|
|
},
|
|
// fix for 'got'/'swarm-js' dependency
|
|
externals: ['got']
|
|
})
|
|
}
|