vue-i18n-loader/lib/utils.js

14 lines
271 B
JavaScript
Raw Normal View History

const hash = require('hash-sum')
const path = require('path')
const createId = (rootPath, resourcePath) => hash(
path
.relative(rootPath, resourcePath)
.replace(/^(\.\.[\/\\])+/, '')
.replace(/\\/g, '/')
)
module.exports = {
createId,
}