jhnns/rewire-webpack — pull request #6 by wrobel (2014-10-29 22:10:41+00:00)
Title: Ignore a global "module" variable

In case global scope has a variable "module" rewire-webpack will include
this variable into the rewired module using "var module = ...". The
function in getImportGlobalsSrc.js is responsible for copying the
globals into such "var ... = ..." definitions.

Webpack however starts each module with the following function wrapper:
"function(module, exports, __webpack_require__) {...}"

Having a "var module = ..." statement within this function will shadow
the "module" parameter from the function definition.

In consequence the module cannot export anything anymore as it exports
to a local variable.

This can be fixed by instructing getImportGlobalsSrc() to ignore the
module variable via "getImportGlobalsSrc(["module"])".