@@ -102,7 +102,12 @@ function toComment(sourceMap) {
102
102
exports [` loader should compile with \` css\` entry point (with \` modules\` and scope \` global\` ): errors 1` ] = ` Array []` ;
103
103
104
104
exports [` loader should compile with \` css\` entry point (with \` modules\` and scope \` global\` ): escape 1` ] = `
105
- "module.exports = (url, needQuotes) => {
105
+ "module.exports = (url, options) => {
106
+ if (! options ) {
107
+ // eslint-disable-next-line no-param-reassign
108
+ options = {};
109
+ }
110
+
106
111
// eslint-disable-next-line no-underscore-dangle, no-param-reassign
107
112
url = url.__esModule ? url.default : url;
108
113
@@ -116,9 +121,14 @@ exports[`loader should compile with \`css\` entry point (with \`modules\` and sc
116
121
url = url .slice (1 , - 1 );
117
122
}
118
123
124
+ if (options.hash) {
125
+ // eslint-disable-next-line no-param-reassign
126
+ url += options .hash ;
127
+ }
128
+
119
129
// Should url be wrapped?
120
130
// See https://drafts.csswg.org/css-values-3/#urls
121
- if (/ [\\ "'() \\\\ t\\\\ n] / .test (url ) || needQuotes ) {
131
+ if (/[\\ "'() \\\\ t\\\\ n]/.test(url) || options. needQuotes) {
122
132
return \` \\ "\$ { url .replace (/ \\ "/ g , ' \\\\\\\\\\ "' ).replace (/ \\\\ n/ g , ' \\\\\\\\ n' )} \\ "\` ;
123
133
}
124
134
@@ -395,7 +405,12 @@ function toComment(sourceMap) {
395
405
exports [` loader should compile with \` css\` entry point (with \` modules\` and scope \` local\` ): errors 1` ] = ` Array []` ;
396
406
397
407
exports [` loader should compile with \` css\` entry point (with \` modules\` and scope \` local\` ): escape 1` ] = `
398
- "module.exports = (url, needQuotes) => {
408
+ "module.exports = (url, options) => {
409
+ if (! options ) {
410
+ // eslint-disable-next-line no-param-reassign
411
+ options = {};
412
+ }
413
+
399
414
// eslint-disable-next-line no-underscore-dangle, no-param-reassign
400
415
url = url.__esModule ? url.default : url;
401
416
@@ -409,9 +424,14 @@ exports[`loader should compile with \`css\` entry point (with \`modules\` and sc
409
424
url = url .slice (1 , - 1 );
410
425
}
411
426
427
+ if (options.hash) {
428
+ // eslint-disable-next-line no-param-reassign
429
+ url += options .hash ;
430
+ }
431
+
412
432
// Should url be wrapped?
413
433
// See https://drafts.csswg.org/css-values-3/#urls
414
- if (/ [\\ "'() \\\\ t\\\\ n] / .test (url ) || needQuotes ) {
434
+ if (/[\\ "'() \\\\ t\\\\ n]/.test(url) || options. needQuotes) {
415
435
return \` \\ "\$ { url .replace (/ \\ "/ g , ' \\\\\\\\\\ "' ).replace (/ \\\\ n/ g , ' \\\\\\\\ n' )} \\ "\` ;
416
436
}
417
437
@@ -712,7 +732,12 @@ function toComment(sourceMap) {
712
732
exports [` loader should compile with \` css\` entry point: errors 1` ] = ` Array []` ;
713
733
714
734
exports [` loader should compile with \` css\` entry point: escape 1` ] = `
715
- "module.exports = (url, needQuotes) => {
735
+ "module.exports = (url, options) => {
736
+ if (! options ) {
737
+ // eslint-disable-next-line no-param-reassign
738
+ options = {};
739
+ }
740
+
716
741
// eslint-disable-next-line no-underscore-dangle, no-param-reassign
717
742
url = url.__esModule ? url.default : url;
718
743
@@ -726,9 +751,14 @@ exports[`loader should compile with \`css\` entry point: escape 1`] = `
726
751
url = url .slice (1 , - 1 );
727
752
}
728
753
754
+ if (options.hash) {
755
+ // eslint-disable-next-line no-param-reassign
756
+ url += options .hash ;
757
+ }
758
+
729
759
// Should url be wrapped?
730
760
// See https://drafts.csswg.org/css-values-3/#urls
731
- if (/ [\\ "'() \\\\ t\\\\ n] / .test (url ) || needQuotes ) {
761
+ if (/[\\ "'() \\\\ t\\\\ n]/.test(url) || options. needQuotes) {
732
762
return \` \\ "\$ { url .replace (/ \\ "/ g , ' \\\\\\\\\\ "' ).replace (/ \\\\ n/ g , ' \\\\\\\\ n' )} \\ "\` ;
733
763
}
734
764
@@ -1005,7 +1035,12 @@ function toComment(sourceMap) {
1005
1035
exports [` loader should compile with \` js\` entry point: errors 1` ] = ` Array []` ;
1006
1036
1007
1037
exports [` loader should compile with \` js\` entry point: escape 1` ] = `
1008
- "module.exports = (url, needQuotes) => {
1038
+ "module.exports = (url, options) => {
1039
+ if (! options ) {
1040
+ // eslint-disable-next-line no-param-reassign
1041
+ options = {};
1042
+ }
1043
+
1009
1044
// eslint-disable-next-line no-underscore-dangle, no-param-reassign
1010
1045
url = url.__esModule ? url.default : url;
1011
1046
@@ -1019,9 +1054,14 @@ exports[`loader should compile with \`js\` entry point: escape 1`] = `
1019
1054
url = url .slice (1 , - 1 );
1020
1055
}
1021
1056
1057
+ if (options.hash) {
1058
+ // eslint-disable-next-line no-param-reassign
1059
+ url += options .hash ;
1060
+ }
1061
+
1022
1062
// Should url be wrapped?
1023
1063
// See https://drafts.csswg.org/css-values-3/#urls
1024
- if (/ [\\ "'() \\\\ t\\\\ n] / .test (url ) || needQuotes ) {
1064
+ if (/[\\ "'() \\\\ t\\\\ n]/.test(url) || options. needQuotes) {
1025
1065
return \` \\ "\$ { url .replace (/ \\ "/ g , ' \\\\\\\\\\ "' ).replace (/ \\\\ n/ g , ' \\\\\\\\ n' )} \\ "\` ;
1026
1066
}
1027
1067
@@ -1490,7 +1530,12 @@ exports.push([module.i, \\".foo {\\\\n color: red;\\\\n}\\\\n\\", \\"\\"]);
1490
1530
/* 4 */
1491
1531
/***/ (function(module, exports) {
1492
1532
1493
- module .exports = (url , needQuotes ) => {
1533
+ module .exports = (url , options ) => {
1534
+ if (! options ) {
1535
+ // eslint-disable-next-line no-param-reassign
1536
+ options = {};
1537
+ }
1538
+
1494
1539
// eslint-disable-next-line no-underscore-dangle, no-param-reassign
1495
1540
url = url .__esModule ? url .default : url ;
1496
1541
@@ -1504,9 +1549,14 @@ module.exports = (url, needQuotes) => {
1504
1549
url = url .slice (1 , - 1 );
1505
1550
}
1506
1551
1552
+ if (options .hash ) {
1553
+ // eslint-disable-next-line no-param-reassign
1554
+ url += options .hash ;
1555
+ }
1556
+
1507
1557
// Should url be wrapped?
1508
1558
// See https://drafts.csswg.org/css-values-3/#urls
1509
- if (/ [\\ "'() \\\\ t\\\\ n] / .test (url ) || needQuotes ) {
1559
+ if (/ [\\ "'() \\\\ t\\\\ n] / .test (url ) || options . needQuotes ) {
1510
1560
return \` \\ "\$ { url .replace (/ \\ "/ g , ' \\\\\\\\\\ "' ).replace (/ \\\\ n/ g , ' \\\\\\\\ n' )} \\ "\` ;
1511
1561
}
1512
1562
@@ -1755,7 +1805,12 @@ exports.push([module.i, \\".foo {\\\\n color: red;\\\\n}\\\\n\\", \\"\\"]);
1755
1805
/* 4 */
1756
1806
/***/ (function(module, exports) {
1757
1807
1758
- module .exports = (url , needQuotes ) => {
1808
+ module .exports = (url , options ) => {
1809
+ if (! options ) {
1810
+ // eslint-disable-next-line no-param-reassign
1811
+ options = {};
1812
+ }
1813
+
1759
1814
// eslint-disable-next-line no-underscore-dangle, no-param-reassign
1760
1815
url = url .__esModule ? url .default : url ;
1761
1816
@@ -1769,9 +1824,14 @@ module.exports = (url, needQuotes) => {
1769
1824
url = url .slice (1 , - 1 );
1770
1825
}
1771
1826
1827
+ if (options .hash ) {
1828
+ // eslint-disable-next-line no-param-reassign
1829
+ url += options .hash ;
1830
+ }
1831
+
1772
1832
// Should url be wrapped?
1773
1833
// See https://drafts.csswg.org/css-values-3/#urls
1774
- if (/ [\\ "'() \\\\ t\\\\ n] / .test (url ) || needQuotes ) {
1834
+ if (/ [\\ "'() \\\\ t\\\\ n] / .test (url ) || options . needQuotes ) {
1775
1835
return \` \\ "\$ { url .replace (/ \\ "/ g , ' \\\\\\\\\\ "' ).replace (/ \\\\ n/ g , ' \\\\\\\\ n' )} \\ "\` ;
1776
1836
}
1777
1837
0 commit comments