|
|
|
@ -49,7 +49,12 @@ class Manifest {
|
|
|
|
|
|
|
|
|
|
Object.keys(files).forEach((key) => {
|
|
|
|
|
files[key].forEach((file) => {
|
|
|
|
|
this._results[stats.publicPath + file] = stats.publicPath + file + '?version=' + this._hash(file, stats.outputPath)
|
|
|
|
|
|
|
|
|
|
const filePath = stats.outputPath + '/' + file
|
|
|
|
|
|
|
|
|
|
if (fs.existsSync(filePath)) {
|
|
|
|
|
this._results[stats.publicPath + file] = stats.publicPath + file + '?version=' + this._hash(filePath)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
@ -64,9 +69,9 @@ class Manifest {
|
|
|
|
|
* @return {string}
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
_hash(file, outputPath) {
|
|
|
|
|
_hash(filePath) {
|
|
|
|
|
|
|
|
|
|
const data = fs.readFileSync(outputPath + '/' + file, 'utf8')
|
|
|
|
|
const data = fs.readFileSync(filePath, 'utf8')
|
|
|
|
|
const hash = crypto
|
|
|
|
|
.createHash('md5')
|
|
|
|
|
.update(data)
|
|
|
|
|