Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix css module HMR (#900)
  • Loading branch information
Allenice authored and yyx990803 committed Jul 29, 2017
1 parent 14b899e commit e6d5956
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/loader.js
Expand Up @@ -182,7 +182,10 @@ module.exports = function (content) {
invokeStyle(`cssModules["${moduleName}"] = ${requireString}`) +
`Object.defineProperty(this, "${moduleName}", { get: function () { return cssModules["${moduleName}"] }})\n`

var requirePath = getRequireString('styles', style, i, style.scoped)
var requirePath = style.src
? getRequireForImportString('styles', style, style.scoped)
: getRequireString('styles', style, i, style.scoped)

output +=
`module.hot && module.hot.accept([${requirePath}], function () {\n` +
// 1. check if style has been injected
Expand Down

0 comments on commit e6d5956

Please sign in to comment.