We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 60e5a1a commit 497e482Copy full SHA for 497e482
lib/gen-id.js
@@ -3,10 +3,11 @@
3
var path = require('path')
4
var hash = require('hash-sum')
5
var cache = Object.create(null)
6
+var sepRE = new RegExp(path.sep.replace('\\', '\\\\'), 'g')
7
8
module.exports = function genId (file, context) {
9
var contextPath = context.split(path.sep)
10
var rootId = contextPath[contextPath.length - 1]
- file = rootId + '/' + path.relative(context, file)
11
+ file = rootId + '/' + path.relative(context, file).replace(sepRE, '/')
12
return cache[file] || (cache[file] = hash(file))
13
}
0 commit comments