Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
url: (...args) => { // TODO: HACK: postcss-url will return asset-url relative to process.cwd(), so calc the relative asset-url again
// console.log('HACK:', args)
const remappedUrl = postcssUrlCopy(...args)
// console.log('HACK:', { remappedUrl, hackedUrl: remappedUrl && normalize(relative(outputRoot, remappedUrl)) })
return remappedUrl && normalize(relative(outputRoot, remappedUrl))
},
})
module.exports = function postcssUrlRewrite (asset, dir) {
const rebasedUrl = normalize(
path.relative(dir.to, asset.absolutePath)
)
return `./${rebasedUrl}${asset.search}${asset.hash}`
}
function postcssUrlRebase(asset, dir) {
const rebasedUrl = normalize(path.relative(dir.to, asset.absolutePath))
return `./${rebasedUrl}${asset.search}${asset.hash}`
}