@@ -35,27 +35,28 @@ export default function loader(content, map, meta) {
3535 const sourceMap = options . sourceMap || false ;
3636 const plugins = [ ] ;
3737
38- if ( shouldUseModulesPlugins ( options . modules , this . resourcePath ) ) {
39- plugins . push ( ...getModulesPlugins ( options , this ) ) ;
40- }
41-
4238 const exportType = options . onlyLocals ? 'locals' : 'full' ;
4339 const preRequester = getPreRequester ( this ) ;
4440 const urlHandler = ( url ) =>
4541 stringifyRequest ( this , preRequester ( options . importLoaders ) + url ) ;
46- const icssResolver = this . getResolve ( {
47- mainFields : [ 'css' , 'style' , 'main' , '...' ] ,
48- mainFiles : [ 'index' , '...' ] ,
49- } ) ;
5042
51- plugins . push (
52- icssParser ( {
53- context : this . context ,
54- rootContext : this . rootContext ,
55- resolver : icssResolver ,
56- urlHandler,
57- } )
58- ) ;
43+ if ( shouldUseModulesPlugins ( options . modules , this . resourcePath ) ) {
44+ plugins . push ( ...getModulesPlugins ( options , this ) ) ;
45+
46+ const icssResolver = this . getResolve ( {
47+ mainFields : [ 'css' , 'style' , 'main' , '...' ] ,
48+ mainFiles : [ 'index' , '...' ] ,
49+ } ) ;
50+
51+ plugins . push (
52+ icssParser ( {
53+ context : this . context ,
54+ rootContext : this . rootContext ,
55+ resolver : icssResolver ,
56+ urlHandler,
57+ } )
58+ ) ;
59+ }
5960
6061 if ( options . import !== false && exportType === 'full' ) {
6162 const resolver = this . getResolve ( {
0 commit comments