@@ -37,7 +37,7 @@ describe('modules', () => {
37
37
} ) ;
38
38
} ) ;
39
39
40
- it ( ` composes should supports resolving` , async ( ) => {
40
+ it ( ' composes should supports resolving' , async ( ) => {
41
41
const config = {
42
42
loader : { options : { import : true , modules : true } } ,
43
43
} ;
@@ -54,7 +54,7 @@ describe('modules', () => {
54
54
expect ( stats . compilation . errors ) . toMatchSnapshot ( 'errors' ) ;
55
55
} ) ;
56
56
57
- it ( ` issue #286` , async ( ) => {
57
+ it ( ' issue #286' , async ( ) => {
58
58
const config = {
59
59
loader : {
60
60
test : / s o u r c e \. c s s $ / ,
@@ -86,4 +86,35 @@ describe('modules', () => {
86
86
expect ( stats . compilation . warnings ) . toMatchSnapshot ( 'warnings' ) ;
87
87
expect ( stats . compilation . errors ) . toMatchSnapshot ( 'errors' ) ;
88
88
} ) ;
89
+
90
+ it ( 'issue #636' , async ( ) => {
91
+ const config = {
92
+ loader : {
93
+ test : / \. s [ c a ] s s $ / i,
94
+ options : {
95
+ modules : true ,
96
+ importLoaders : 1 ,
97
+ localIdentName : '[local]' ,
98
+ getLocalIdent : ( context , localIdentName , localName ) =>
99
+ `prefix-${ localName } ` ,
100
+ } ,
101
+ } ,
102
+ sassLoader : true ,
103
+ sassLoaderOptions : {
104
+ // eslint-disable-next-line global-require
105
+ implementation : require ( 'sass' ) ,
106
+ } ,
107
+ } ;
108
+ const testId = './modules/issue-636/source.scss' ;
109
+ const stats = await webpack ( testId , config ) ;
110
+ const { modules } = stats . toJson ( ) ;
111
+ const module = modules . find ( ( m ) => m . id === testId ) ;
112
+
113
+ expect ( module . source ) . toMatchSnapshot ( 'module' ) ;
114
+ expect ( evaluated ( module . source , modules ) ) . toMatchSnapshot (
115
+ 'module (evaluated)'
116
+ ) ;
117
+ expect ( stats . compilation . warnings ) . toMatchSnapshot ( 'warnings' ) ;
118
+ expect ( stats . compilation . errors ) . toMatchSnapshot ( 'errors' ) ;
119
+ } ) ;
89
120
} ) ;
0 commit comments