File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -63,14 +63,19 @@ module.exports.pitch = function (remainingRequest) {
6363 // also make sure to dedupe based on loader path.
6464 // assumes you'd probably never want to apply the same loader on the same
6565 // file twice.
66+ // Exception: in Vue CLI we do need two instances of postcss-loader
67+ // for user config and inline minification. So we need to dedupe baesd on
68+ // path AND query to be safe.
6669 const seen = new Map ( )
6770 const loaderStrings = [ ]
6871
6972 loaders . forEach ( loader => {
70- const type = typeof loader === 'string' ? loader : loader . path
73+ const identifier = typeof loader === 'string'
74+ ? loader
75+ : ( loader . path + loader . query )
7176 const request = typeof loader === 'string' ? loader : loader . request
72- if ( ! seen . has ( type ) ) {
73- seen . set ( type , true )
77+ if ( ! seen . has ( identifier ) ) {
78+ seen . set ( identifier , true )
7479 // loader.request contains both the resolved loader path and its options
7580 // query (e.g. ??ref-0)
7681 loaderStrings . push ( request )
You can’t perform that action at this time.
0 commit comments