Commit b16311fa authored by Clark Du's avatar Clark Du Committed by Evan You

fix: reuse ident of css related loaders to avoid duplicates (#1233)

parent b9833041
......@@ -145,11 +145,19 @@ function cloneRule (rule, normalizedRule) {
return res
}
const reuseIdentWhitelist = /css-loader/
const reuseIdentWhitelist = [
'css-loader',
'(vue-)?style-loader',
'postcss-loader',
'extract-text-webpack-plugin',
'mini-css-extract-plugin'
]
const reuseIdentPattern = new RegExp(`(${reuseIdentWhitelist.join('|')})`)
function cleanIdent (use) {
if (use.ident) {
if (reuseIdentWhitelist.test(use.loader)) {
if (reuseIdentPattern.test(use.loader)) {
// Reuse options ident, so that imports from within css-loader would get the
// exact same request prefixes, avoiding duplicated modules (#1199)
use.options.ident = use.ident
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment