Files
2026-09-08 20:28:54 +08:00

16 lines
424 B
JavaScript

const isWin = /^win/.test(process.platform)
const normalizePath = path => (isWin ? path.replace(/\\/g, '/') : path)
const src = require('@dcloudio/uni-h5/path').src
module.exports = function (content) {
this.cacheable && this.cacheable()
const resourcePath = normalizePath(this.resourcePath)
const sourcePath = normalizePath(src)
if (resourcePath.indexOf(sourcePath) === 0) {
return ''
}
return content
}