@@ -560,4 +560,111 @@ describe("webpackConfig", () => {
560
560
}
561
561
` ) ;
562
562
} ) ;
563
+
564
+ it ( "Overrides matching rules" , ( ) => {
565
+ expect (
566
+ webpackConfig ( ( env ) => ( {
567
+ module : {
568
+ rules : [ { test : / \. c s s $ / , loader : "css-loader" } ] ,
569
+ } ,
570
+ } ) ) ( "production" )
571
+ ) . toMatchInlineSnapshot ( `
572
+ Object {
573
+ "devtool": false,
574
+ "mode": "production",
575
+ "module": Object {
576
+ "rules": Array [
577
+ Object {
578
+ "loader": "ts-loader",
579
+ "test": /\\\\\\.tsx\\?\\$/,
580
+ },
581
+ Object {
582
+ "test": /\\\\\\.\\(png\\|svg\\|jpg\\|jpeg\\|gif\\|woff\\|woff2\\|eot\\|ttf\\|otf\\)\\$/i,
583
+ "type": "asset/resource",
584
+ },
585
+ Object {
586
+ "loader": "css-loader",
587
+ "test": /\\\\\\.css\\$/,
588
+ },
589
+ ],
590
+ },
591
+ "optimization": Object {
592
+ "runtimeChunk": "single",
593
+ "splitChunks": Object {
594
+ "cacheGroups": Object {
595
+ "vendor": Object {
596
+ "chunks": "all",
597
+ "name": "vendors",
598
+ "test": /\\[\\\\\\\\/\\]node_modules\\[\\\\\\\\/\\]/,
599
+ },
600
+ },
601
+ },
602
+ },
603
+ "output": Object {
604
+ "filename": "[name].[contenthash].js",
605
+ "pathinfo": true,
606
+ },
607
+ "plugins": Array [
608
+ MiniCssExtractPlugin {
609
+ "_sortedModulesCache": WeakMap {},
610
+ "options": Object {
611
+ "chunkFilename": "[id].css",
612
+ "experimentalUseImportModule": undefined,
613
+ "filename": "[name]-[chunkhash].css",
614
+ "ignoreOrder": false,
615
+ "runtime": true,
616
+ },
617
+ "runtimeOptions": Object {
618
+ "attributes": undefined,
619
+ "insert": undefined,
620
+ "linkType": "text/css",
621
+ },
622
+ },
623
+ ErrorReportingPlugin {},
624
+ DefinePlugin {
625
+ "definitions": Object {
626
+ "NODE_ENV": "production",
627
+ },
628
+ },
629
+ CleanWebpackPlugin {
630
+ "apply": [Function],
631
+ "cleanAfterEveryBuildPatterns": Array [],
632
+ "cleanOnceBeforeBuildPatterns": Array [
633
+ "**/*",
634
+ ],
635
+ "cleanStaleWebpackAssets": true,
636
+ "currentAssets": Array [],
637
+ "dangerouslyAllowCleanPatternsOutsideProject": false,
638
+ "dry": false,
639
+ "handleDone": [Function],
640
+ "handleInitial": [Function],
641
+ "initialClean": false,
642
+ "outputPath": "",
643
+ "protectWebpackAssets": true,
644
+ "removeFiles": [Function],
645
+ "verbose": false,
646
+ },
647
+ ],
648
+ "resolve": Object {
649
+ "extensions": Array [
650
+ ".purs",
651
+ ".js",
652
+ ".ts",
653
+ ".tsx",
654
+ ],
655
+ "modules": Array [
656
+ "node_modules",
657
+ ],
658
+ },
659
+ "resolveLoader": Object {
660
+ "modules": Array [
661
+ "node_modules",
662
+ ],
663
+ },
664
+ "stats": Object {
665
+ "children": false,
666
+ },
667
+ }
668
+ ` ) ;
669
+ } ) ;
563
670
} ) ;
0 commit comments