css-loader 1.0.1 → 7.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+
3
+ /*
4
+ MIT License http://www.opensource.org/licenses/mit-license.php
5
+ Author Tobias Koppers @sokra
6
+ */
7
+ module.exports = function (cssWithMappingToString) {
8
+ var list = [];
9
+
10
+ // return the list of modules as css string
11
+ list.toString = function toString() {
12
+ return this.map(function (item) {
13
+ var content = "";
14
+ var needLayer = typeof item[5] !== "undefined";
15
+ if (item[4]) {
16
+ content += "@supports (".concat(item[4], ") {");
17
+ }
18
+ if (item[2]) {
19
+ content += "@media ".concat(item[2], " {");
20
+ }
21
+ if (needLayer) {
22
+ content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {");
23
+ }
24
+ content += cssWithMappingToString(item);
25
+ if (needLayer) {
26
+ content += "}";
27
+ }
28
+ if (item[2]) {
29
+ content += "}";
30
+ }
31
+ if (item[4]) {
32
+ content += "}";
33
+ }
34
+ return content;
35
+ }).join("");
36
+ };
37
+
38
+ // import a list of modules into the list
39
+ list.i = function i(modules, media, dedupe, supports, layer) {
40
+ if (typeof modules === "string") {
41
+ modules = [[null, modules, undefined]];
42
+ }
43
+ var alreadyImportedModules = {};
44
+ if (dedupe) {
45
+ for (var k = 0; k < this.length; k++) {
46
+ var id = this[k][0];
47
+ if (id != null) {
48
+ alreadyImportedModules[id] = true;
49
+ }
50
+ }
51
+ }
52
+ for (var _k = 0; _k < modules.length; _k++) {
53
+ var item = [].concat(modules[_k]);
54
+ if (dedupe && alreadyImportedModules[item[0]]) {
55
+ continue;
56
+ }
57
+ if (typeof layer !== "undefined") {
58
+ if (typeof item[5] === "undefined") {
59
+ item[5] = layer;
60
+ } else {
61
+ item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}");
62
+ item[5] = layer;
63
+ }
64
+ }
65
+ if (media) {
66
+ if (!item[2]) {
67
+ item[2] = media;
68
+ } else {
69
+ item[1] = "@media ".concat(item[2], " {").concat(item[1], "}");
70
+ item[2] = media;
71
+ }
72
+ }
73
+ if (supports) {
74
+ if (!item[4]) {
75
+ item[4] = "".concat(supports);
76
+ } else {
77
+ item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}");
78
+ item[4] = supports;
79
+ }
80
+ }
81
+ list.push(item);
82
+ }
83
+ };
84
+ return list;
85
+ };
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ module.exports = function (url, options) {
4
+ if (!options) {
5
+ options = {};
6
+ }
7
+ if (!url) {
8
+ return url;
9
+ }
10
+ url = String(url.__esModule ? url.default : url);
11
+
12
+ // If url is already wrapped in quotes, remove them
13
+ if (/^['"].*['"]$/.test(url)) {
14
+ url = url.slice(1, -1);
15
+ }
16
+ if (options.hash) {
17
+ url += options.hash;
18
+ }
19
+
20
+ // Should url be wrapped?
21
+ // See https://drafts.csswg.org/css-values-3/#urls
22
+ if (/["'() \t\n]|(%20)/.test(url) || options.needQuotes) {
23
+ return "\"".concat(url.replace(/"/g, '\\"').replace(/\n/g, "\\n"), "\"");
24
+ }
25
+ return url;
26
+ };
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ module.exports = function (i) {
4
+ return i[1];
5
+ };
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ module.exports = function (item) {
4
+ var content = item[1];
5
+ var cssMapping = item[3];
6
+ if (!cssMapping) {
7
+ return content;
8
+ }
9
+ if (typeof btoa === "function") {
10
+ var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));
11
+ var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64);
12
+ var sourceMapping = "/*# ".concat(data, " */");
13
+ return [content].concat([sourceMapping]).join("\n");
14
+ }
15
+ return [content].join("\n");
16
+ };