@@ -147,33 +147,40 @@ module.exports = function processCss(inputSource, inputMap, options, callback) {
147
147
import : query . import !== false
148
148
} ;
149
149
150
- var pipeline = postcss ( [
151
- localByDefault ( {
152
- mode : options . mode ,
153
- rewriteUrl : function ( global , url ) {
154
- if ( parserOptions . url ) {
155
- if ( ! loaderUtils . isUrlRequest ( url , root ) ) {
156
- return url ;
157
- }
158
- if ( global ) {
159
- return loaderUtils . urlToRequest ( url , root ) ;
150
+ var pipeline = postcss (
151
+ ( options . mode === 'local' ? [
152
+ /* LOCAL ONLY POSTCSS PLUGINS */
153
+ localByDefault ( {
154
+ mode : options . mode ,
155
+ rewriteUrl : function ( global , url ) {
156
+ if ( parserOptions . url ) {
157
+ if ( ! loaderUtils . isUrlRequest ( url , root ) ) {
158
+ return url ;
159
+ }
160
+ if ( global ) {
161
+ return loaderUtils . urlToRequest ( url , root ) ;
162
+ }
160
163
}
164
+ return url ;
161
165
}
162
- return url ;
163
- }
164
- } ) ,
165
- extractImports ( ) ,
166
- modulesValues ,
167
- modulesScope ( {
168
- generateScopedName : function ( exportName ) {
169
- return getLocalIdent ( options . loaderContext , localIdentName , exportName , {
170
- regExp : localIdentRegExp ,
171
- hashPrefix : query . hashPrefix || "" ,
172
- context : context
173
- } ) ;
174
- }
175
- } ) ,
176
- parserPlugin ( parserOptions )
166
+ } ) ,
167
+ extractImports ( ) ,
168
+ modulesValues ,
169
+ modulesScope ( {
170
+ generateScopedName : function ( exportName ) {
171
+ return getLocalIdent ( options . loaderContext , localIdentName , exportName , {
172
+ regExp : localIdentRegExp ,
173
+ hashPrefix : query . hashPrefix || "" ,
174
+ context : context
175
+ } ) ;
176
+ }
177
+ } )
178
+ ] : [
179
+ /* GLOBAL ONLY POSTCSS PLUGINS */
180
+ ] ) . concat ( [
181
+ /* COMMON POSTCSS PLUGINS */
182
+ parserPlugin ( parserOptions )
183
+ ] )
177
184
] ) ;
178
185
179
186
if ( minimize ) {
0 commit comments