Skip to content

Commit

Permalink
fix: ensure userRequest stays unique (module.userRequest) (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
timse authored and michael-ciniawsky committed Nov 17, 2017
1 parent 0480049 commit b45fd4c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ module.exports.pitch = function(remainingRequest) {
);
this.cacheable && this.cacheable();
if(!this.query) throw new Error("query parameter is missing");
/*
* Workaround until module.libIdent() in webpack/webpack handles this correctly.
*
* fixes:
* - https://github.com/webpack-contrib/expose-loader/issues/55
* - https://github.com/webpack-contrib/expose-loader/issues/49
*/
this._module.userRequest = this._module.userRequest + '-exposed';
return accesorString(this.query.substr(1)) + " = " +
"require(" + JSON.stringify("-!" + newRequestPath) + ");";
};

0 comments on commit b45fd4c

Please sign in to comment.