@@ -37,7 +37,7 @@ describe('modules', () => {
3737 } ) ;
3838 } ) ;
3939
40- it ( ` composes should supports resolving` , async ( ) => {
40+ it ( ' composes should supports resolving' , async ( ) => {
4141 const config = {
4242 loader : { options : { import : true , modules : true } } ,
4343 } ;
@@ -54,7 +54,7 @@ describe('modules', () => {
5454 expect ( stats . compilation . errors ) . toMatchSnapshot ( 'errors' ) ;
5555 } ) ;
5656
57- it ( ` issue #286` , async ( ) => {
57+ it ( ' issue #286' , async ( ) => {
5858 const config = {
5959 loader : {
6060 test : / s o u r c e \. c s s $ / ,
@@ -86,4 +86,35 @@ describe('modules', () => {
8686 expect ( stats . compilation . warnings ) . toMatchSnapshot ( 'warnings' ) ;
8787 expect ( stats . compilation . errors ) . toMatchSnapshot ( 'errors' ) ;
8888 } ) ;
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+ } ) ;
89120} ) ;
0 commit comments