Skip to content

Commit

Permalink
build fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kremalicious committed Aug 17, 2023
1 parent c20c7a1 commit 674fb59
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions gatsby-node.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { GatsbyNode } from 'gatsby'
import webpack from 'webpack'
import { createExif } from './gatsby/createExif'
import { createMarkdownFields } from './gatsby/createMarkdownFields'
import {
Expand Down Expand Up @@ -158,14 +159,22 @@ export const onPostBuild: GatsbyNode['onPostBuild'] = async ({ graphql }) => {
return Promise.resolve()
}

export const onCreateWebpackConfig: GatsbyNode['onCreateWebpackConfig'] = ({
actions
}) => {
actions.setWebpackConfig({
resolve: {
fallback: {
util: false
export const onCreateWebpackConfig: GatsbyNode['onCreateWebpackConfig'] =
async ({ actions }) => {
actions.setWebpackConfig({
plugins: [
new webpack.NormalModuleReplacementPlugin(/node:/, (resource) => {
resource.request = resource.request.replace(/^node:/, '')
})
],
resolve: {
fallback: {
util: false,
crypto: false,
path: false,
process: false,
url: false
}
}
}
})
}
})
}

1 comment on commit 674fb59

@vercel
Copy link

@vercel vercel bot commented on 674fb59 Aug 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

blog – ./

blog-kremalicious.vercel.app
kremalicious.vercel.app
blog-git-main-kremalicious.vercel.app

Please sign in to comment.