Skip to content

Commit

Permalink
fix(server): fix usage when compiled using webpack (#185)
Browse files Browse the repository at this point in the history
Closes #181
  • Loading branch information
gregberge committed Dec 12, 2018
1 parent ad9350c commit 5e28870
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/server/src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ export const smartRequire = modulePath => {
clearModuleCache(modulePath)
}

// eslint-disable-next-line global-require, import/no-dynamic-require
return require(modulePath)
// Use eval to prevent Webpack from compiling it
// when the server-side code is compiled with Webpack
// eslint-disable-next-line no-eval
return eval('module.require')(modulePath)
}

export const joinURLPath = (...paths) => {
Expand Down

0 comments on commit 5e28870

Please sign in to comment.