@@ -35,27 +35,28 @@ export default function loader(content, map, meta) {
35
35
const sourceMap = options . sourceMap || false ;
36
36
const plugins = [ ] ;
37
37
38
- if ( shouldUseModulesPlugins ( options . modules , this . resourcePath ) ) {
39
- plugins . push ( ...getModulesPlugins ( options , this ) ) ;
40
- }
41
-
42
38
const exportType = options . onlyLocals ? 'locals' : 'full' ;
43
39
const preRequester = getPreRequester ( this ) ;
44
40
const urlHandler = ( url ) =>
45
41
stringifyRequest ( this , preRequester ( options . importLoaders ) + url ) ;
46
- const icssResolver = this . getResolve ( {
47
- mainFields : [ 'css' , 'style' , 'main' , '...' ] ,
48
- mainFiles : [ 'index' , '...' ] ,
49
- } ) ;
50
42
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
+ }
59
60
60
61
if ( options . import !== false && exportType === 'full' ) {
61
62
const resolver = this . getResolve ( {
0 commit comments