Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore a global "module" variable #6

Closed
wants to merge 1 commit into from
Closed

Ignore a global "module" variable #6

wants to merge 1 commit into from

Commits on Oct 29, 2014

  1. 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 variable.
    
    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"])".
    wrobel committed Oct 29, 2014
    Configuration menu
    Copy the full SHA
    4f84e8d View commit details
    Browse the repository at this point in the history