Skip to content

Commit

Permalink
fix($loader): handle weird edge case when using vue-loader
Browse files Browse the repository at this point in the history
  • Loading branch information
faceyspacey committed Aug 25, 2017
1 parent 6befee5 commit fdbe0e6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ module.exports = function(source) {

// We need to always require hotModuleReplacement.js for HMR to work in a wierd scenario
// where only one css file is imported. Otherwise HMR breaks when modules are disposed.
return `${source}
require(${loaderUtils.stringifyRequest(this, path.join(__dirname, "hotModuleReplacement.js"))})`;
return `
require(${loaderUtils.stringifyRequest(this, path.join(__dirname, "hotModuleReplacement.js"))})
${source}`;
};


module.exports.pitch = function(request) {
var self = this;
var remainingRequest = request;
Expand Down

0 comments on commit fdbe0e6

Please sign in to comment.