File tree 2 files changed +54
-0
lines changed
2 files changed +54
-0
lines changed Original file line number Diff line number Diff line change @@ -6355,6 +6355,33 @@ exports.locals = {
6355
6355
6356
6356
exports [` modules issue #861: warnings 1` ] = ` Array []` ;
6357
6357
6358
+ exports [` modules issue #966: errors 1` ] = ` Array []` ;
6359
+
6360
+ exports [` modules issue #966: module (evaluated) 1` ] = `
6361
+ Array [
6362
+ Array [
6363
+ 1,
6364
+ ".button.hey {
6365
+ color : red ;
6366
+ }
6367
+ ",
6368
+ "",
6369
+ ],
6370
+ ]
6371
+ ` ;
6372
+
6373
+ exports [` modules issue #966: module 1` ] = `
6374
+ "exports = module.exports = require(\\ "../../../../src/runtime/api.js\\ ")(false);
6375
+ // Module
6376
+ exports.push([module.id, \\ ".button.hey { \\\\n color : red ;\\\\n } \\\\ n\\ ", \\ "\\ "]);
6377
+ // Exports
6378
+ exports.locals = {
6379
+ \\" button\\ " : \\" button.hey\\ "
6380
+ } ;"
6381
+ ` ;
6382
+
6383
+ exports [` modules issue #966: warnings 1` ] = ` Array []` ;
6384
+
6358
6385
exports [` modules issue #967: errors 1` ] = ` Array []` ;
6359
6386
6360
6387
exports [` modules issue #967: module (evaluated) 1` ] = `
Original file line number Diff line number Diff line change @@ -485,4 +485,31 @@ describe('modules', () => {
485
485
expect ( stats . compilation . warnings ) . toMatchSnapshot ( 'warnings' ) ;
486
486
expect ( stats . compilation . errors ) . toMatchSnapshot ( 'errors' ) ;
487
487
} ) ;
488
+
489
+ it ( 'issue #966' , async ( ) => {
490
+ const config = {
491
+ loader : {
492
+ options : {
493
+ modules : {
494
+ getLocalIdent : ( ctx , localIdentName , localName ) => {
495
+ console . log ( localIdentName ) ;
496
+ console . log ( localName ) ;
497
+ return `${ localName } .hey` ;
498
+ } ,
499
+ } ,
500
+ } ,
501
+ } ,
502
+ } ;
503
+ const testId = './modules/issue-966/button.css' ;
504
+ const stats = await webpack ( testId , config ) ;
505
+ const { modules } = stats . toJson ( ) ;
506
+ const module = modules . find ( ( m ) => m . id === testId ) ;
507
+
508
+ expect ( module . source ) . toMatchSnapshot ( 'module' ) ;
509
+ expect ( evaluated ( module . source , modules ) ) . toMatchSnapshot (
510
+ 'module (evaluated)'
511
+ ) ;
512
+ expect ( stats . compilation . warnings ) . toMatchSnapshot ( 'warnings' ) ;
513
+ expect ( stats . compilation . errors ) . toMatchSnapshot ( 'errors' ) ;
514
+ } ) ;
488
515
} ) ;
You can’t perform that action at this time.
0 commit comments