Skip to content

Commit

Permalink
fix: pnpm stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Marvin Heilemann committed Feb 4, 2020
1 parent 55fc614 commit 2a896fd
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
1 change: 1 addition & 0 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ console.log(`Auditing: ${yellow(isAudit)}\n`)
module.exports = {
siteMetadata,
plugins: [
`gatsby-plugin-pnpm`,
`gatsby-plugin-preact`,
`gatsby-plugin-layout`,
`gatsby-plugin-react-helmet-async`,
Expand Down
9 changes: 9 additions & 0 deletions gatsby/node/onCreateWebpackConfig.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
const path = require('path')
const { getVersion } = require('../../utils/version')
const { isProd } = require('../../utils/environment')

// BUG: https://github.com/webpack/webpack/issues/5087
// BUG: https://github.com/Js-Brecht/gatsby-plugin-pnpm/issues/1
const nodePath = (process.env.NODE_PATH &&
process.env.NODE_PATH.split(path.delimiter)) || [path.join(__dirname, 'node_modules')]

module.exports = async ({ actions, plugins }) => {
const { setWebpackConfig } = actions

await setWebpackConfig({
devtool: isProd ? false : 'cheap-module-source-map',
resolveLoader: {
modules: nodePath,
},
plugins: [
plugins.define({
'process.env': {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"gatsby-plugin-manifest": "^2.2.41",
"gatsby-plugin-mdx": "^1.0.70",
"gatsby-plugin-offline": "^3.0.34",
"gatsby-plugin-pnpm": "^1.0.0",
"gatsby-plugin-postcss": "^2.1.20",
"gatsby-plugin-preact": "^3.1.26",
"gatsby-plugin-react-axe": "^0.3.0",
Expand Down Expand Up @@ -120,4 +121,4 @@
"node": ">=12",
"pnpm": ">=4"
}
}
}
10 changes: 10 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2a896fd

Please sign in to comment.