Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
to: file,
from: file,
}
const asset = compilation.assets[file]
let input: string
if (postcssOptions.map && asset.sourceAndMap) {
const { source, map } = asset.sourceAndMap()
input = source
postcssOptions.map.prev = map ? map : false
} else {
input = asset.source()
}
return minify(input, postcssOptions).then(res => {
if (res.map) {
compilation.assets[file] = new SourceMapSource(
res.css,
file,
res.map.toJSON()
)
} else {
compilation.assets[file] = new RawSource(res.css)
}
})
})
)