Skip to content
This repository has been archived by the owner on Mar 23, 2018. It is now read-only.

Commit

Permalink
fix issue of chunkhash changes everytime
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Dec 17, 2016
1 parent 6b0daca commit e9398dc
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 85 deletions.
10 changes: 6 additions & 4 deletions packages/vue-template-es2015-loader/gen-id.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
let uid = 0
const uidRegistry = Object.create(null)
// utility for generating a uid for each component file
// used in scoped CSS rewriting
const hash = require('hash-sum')
const cache = Object.create(null)

module.exports = function genId(filePath) {
return uidRegistry[filePath] || (uidRegistry[filePath] = ++uid)
module.exports = function genId(file) {
return cache[file] || (cache[file] = hash(file))
}
Loading

0 comments on commit e9398dc

Please sign in to comment.