Skip to content
Permalink
Browse files
fix css module HMR (#900)
  • Loading branch information
Allenice authored and yyx990803 committed Jul 29, 2017
1 parent 14b899e commit e6d5956f80233a0349bda735485e1a2c66c60c5f
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/loader.js
@@ -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

0 comments on commit e6d5956

Please sign in to comment.