theKashey/rewiremock

Configuration for Mocha/webpack5

cardosoj-ppb opened this issue · 1 comments

Hi,
In our applications we have been using this plugin for a while.
Recently. we needed to bump our webpack version to webpack5.

When running our tests we get an error:

/***/if(typeof __webpack_require__!=='undefined') {
     ^^

SyntaxError: Unexpected token 'if'

This seems like an incompatibility with webpack5.

Currently we are using Node 14 (nvm use 14) withe that following package versions:

"mocha": "10.0.0",
"rewiremock": "3.14.3",
"webpack": "5.46.0"

Thanks

Duplicate of #134