mirror of
https://github.com/fullstack-cash/fullstack-gatsby-theme-bch-wallet.git
synced 2026-09-22 01:02:06 -07:00
35 lines
876 B
JavaScript
35 lines
876 B
JavaScript
const path = require('path')
|
|
exports.onCreateWebpackConfig = ({ stage, actions, getConfig }) => {
|
|
actions.setWebpackConfig({
|
|
node: {
|
|
fs: 'empty'
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
react: path.resolve('./node_modules/react'),
|
|
'react-dom': path.resolve('./node_modules/react-dom')
|
|
}
|
|
}
|
|
})
|
|
|
|
// Ignore css order
|
|
if (stage === 'build-javascript') {
|
|
const config = getConfig()
|
|
const miniCssExtractPlugin = config.plugins.find(
|
|
plugin => plugin.constructor.name === 'MiniCssExtractPlugin'
|
|
)
|
|
if (miniCssExtractPlugin) {
|
|
miniCssExtractPlugin.options.ignoreOrder = true
|
|
}
|
|
actions.replaceWebpackConfig(config)
|
|
}
|
|
}
|
|
|
|
exports.createPages = async ({ actions }, themeOptions) => {
|
|
const basePath = '/'
|
|
actions.createPage({
|
|
path: basePath,
|
|
component: require.resolve('./src/pages/index.js')
|
|
})
|
|
}
|