asset.js 313 B

123456789101112131415
  1. const crypto = require('crypto')
  2. const path = require('path')
  3. module.exports = {
  4. /**
  5. * Generate unique hash from page
  6. */
  7. generateHash(assetPath) {
  8. return crypto.createHash('sha1').update(assetPath).digest('hex')
  9. },
  10. getPathInfo(assetPath) {
  11. return path.parse(assetPath.toLowerCase())
  12. }
  13. }