Files
fullstack-gatsby-theme-bch-…/gatsby-node.js
T

28 lines
687 B
JavaScript
Raw Normal View History

exports.onCreateWebpackConfig = ({ stage, actions, getConfig }) => {
actions.setWebpackConfig({
node: {
2020-07-06 13:56:15 -07:00
fs: 'empty'
}
})
2020-07-06 13:56:15 -07:00
// Ignore css order
if (stage === 'build-javascript') {
const config = getConfig()
const miniCssExtractPlugin = config.plugins.find(
2020-07-06 13:56:15 -07:00
plugin => plugin.constructor.name === 'MiniCssExtractPlugin'
)
if (miniCssExtractPlugin) {
miniCssExtractPlugin.options.ignoreOrder = true
}
actions.replaceWebpackConfig(config)
}
}
exports.createPages = async ({ actions }, themeOptions) => {
2020-07-06 13:56:15 -07:00
const basePath = '/'
actions.createPage({
path: basePath,
2020-07-06 13:56:15 -07:00
component: require.resolve('./src/pages/index.js')
})
}