fix(build): Fixed build error introduced in last commit

This commit is contained in:
Daniel Gonzalez
2020-06-22 15:15:19 -04:00
parent 4d484c9758
commit 792c899f5c
2 changed files with 25 additions and 13 deletions
+19 -7
View File
@@ -1,8 +1,20 @@
exports.onCreateWebpackConfig = ({ actions }) => {
actions.setWebpackConfig({
node: {
fs: 'empty'
},
})
}
exports.onCreateWebpackConfig = ({ stage, actions, getConfig }) => {
actions.setWebpackConfig({
node: {
fs: "empty",
},
})
//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)
}
}
+6 -6
View File
@@ -10,12 +10,14 @@ import PropTypes from "prop-types"
//import { useStaticQuery, graphql } from "gatsby"
//import Header from "./header"
import "./app-colors.css"
import "./layout.css"
import Footer from './footer'
let Footer = typeof window !== `undefined` ? require("./footer").default : null
//import Footer from "./footer"
const Layout = ({ children }) => {
/* const data = useStaticQuery(graphql`
/* const data = useStaticQuery(graphql`
query SiteTitleQuery {
site {
siteMetadata {
@@ -27,13 +29,11 @@ const Layout = ({ children }) => {
return (
<>
<main>{children}</main>
<Footer></Footer>
<main>{children}</main>
{Footer && <Footer />}{" "}
</>
)
}
Layout.propTypes = {
children: PropTypes.node.isRequired,
}