Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
process.env.NODE_ENV === 'production' &&
process.env.UNI_PLATFORM !== 'app-plus'
) {
const targetCssName = `common/main${ext}`
if (!compilation.assets[targetCssName]) {
compilation.assets[targetCssName] = {
size () {
return Buffer.byteLength(getShadowCss(), 'utf8')
},
source () {
return getShadowCss()
}
}
} else {
const source = compilation.assets[targetCssName].source() + getShadowCss()
compilation.assets[targetCssName] = {
size () {
return Buffer.byteLength(source, 'utf8')
},
source () {
return source
}
}
}
}
if (compilation.assets[`common/main${ext}`]) { // 是否存在 main.css
importMainCss = `@import './common/main${ext}';`
}
if (compilation.assets[`common/vendor${ext}`]) { // 是否存在 vendor.css
size () {
return Buffer.byteLength(getShadowCss(), 'utf8')
},
source () {