Skip to content

Commit

Permalink
fix: noop @prisma/client in browser, closes #13
Browse files Browse the repository at this point in the history
  • Loading branch information
jimthedev committed Feb 28, 2020
1 parent c48fd89 commit 17e2994
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion examples/first-demo/next.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
const path = require('path')
// NOTE: This is ONLY needed in this Blitz monorepo so that package hot reloading works properly
const withTM = require('next-transpile-modules')(['@blitzjs/core'])
module.exports = withTM({})
module.exports = withTM({
webpack: (config, {buildId, dev, isServer, defaultLoaders, webpack}) => {
if (!isServer) {
// Noop resolution of @prisma/client in the browser
// since setting an alias to false does not work
config.resolve.alias['@prisma/client'] = path.join(__dirname, 'noop.js')
}
return config
},
})
Empty file added examples/first-demo/noop.js
Empty file.

0 comments on commit 17e2994

Please sign in to comment.