css-loader 5.2.2 → 5.2.6
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.
- package/README.md +33 -10
- package/dist/index.js +3 -2
- package/dist/plugins/postcss-icss-parser.js +16 -8
- package/dist/plugins/postcss-import-parser.js +12 -5
- package/dist/plugins/postcss-url-parser.js +12 -7
- package/dist/runtime/cssWithMappingToString.js +1 -1
- package/dist/utils.js +150 -32
- package/package.json +22 -23
- package/CHANGELOG.md +0 -618
package/README.md
CHANGED
|
@@ -125,8 +125,7 @@ module.exports = {
|
|
|
125
125
|
Type: `Boolean|Function`
|
|
126
126
|
Default: `true`
|
|
127
127
|
|
|
128
|
-
Enables/Disables `url
|
|
129
|
-
Control `url()` resolving. Absolute paths and root-relative URLs now resolving(Version [4.0.0](https://github.com/webpack-contrib/css-loader/blob/master/CHANGELOG.md#400-2020-07-25) and above).
|
|
128
|
+
Enables/Disables handling the CSS functions `url` and `image-set`. If set to `false`, `css-loader` will not parse any paths specified in `url` or `image-set`. A function can also be passed to control this behavior dynamically based on the path to the asset. Starting with version [4.0.0](https://github.com/webpack-contrib/css-loader/blob/master/CHANGELOG.md#400-2020-07-25), absolute paths are parsed based on the server root.
|
|
130
129
|
|
|
131
130
|
Examples resolutions:
|
|
132
131
|
|
|
@@ -1132,6 +1131,38 @@ module.exports = {
|
|
|
1132
1131
|
|
|
1133
1132
|
## Examples
|
|
1134
1133
|
|
|
1134
|
+
### Recommend
|
|
1135
|
+
|
|
1136
|
+
For `production` builds it's recommended to extract the CSS from your bundle being able to use parallel loading of CSS/JS resources later on.
|
|
1137
|
+
This can be achieved by using the [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin), because it creates separate css files.
|
|
1138
|
+
For `development` mode (including `webpack-dev-server`) you can use [style-loader](https://github.com/webpack-contrib/style-loader), because it injects CSS into the DOM using multiple <style></style> and works faster.
|
|
1139
|
+
|
|
1140
|
+
> i Do not use together `style-loader` and `mini-css-extract-plugin`.
|
|
1141
|
+
|
|
1142
|
+
**webpack.config.js**
|
|
1143
|
+
|
|
1144
|
+
```js
|
|
1145
|
+
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
|
1146
|
+
const devMode = process.env.NODE_ENV !== "production";
|
|
1147
|
+
|
|
1148
|
+
module.exports = {
|
|
1149
|
+
module: {
|
|
1150
|
+
rules: [
|
|
1151
|
+
{
|
|
1152
|
+
test: /\.(sa|sc|c)ss$/,
|
|
1153
|
+
use: [
|
|
1154
|
+
devMode ? "style-loader" : MiniCssExtractPlugin.loader,
|
|
1155
|
+
"css-loader",
|
|
1156
|
+
"postcss-loader",
|
|
1157
|
+
"sass-loader",
|
|
1158
|
+
],
|
|
1159
|
+
},
|
|
1160
|
+
],
|
|
1161
|
+
},
|
|
1162
|
+
plugins: [].concat(devMode ? [] : [new MiniCssExtractPlugin()]),
|
|
1163
|
+
};
|
|
1164
|
+
```
|
|
1165
|
+
|
|
1135
1166
|
### Disable url resolving using the `/* webpackIgnore: true */` comment
|
|
1136
1167
|
|
|
1137
1168
|
With the help of the `/* webpackIgnore: true */`comment, it is possible to disable sources handling for rules and for individual declarations.
|
|
@@ -1236,14 +1267,6 @@ module.exports = {
|
|
|
1236
1267
|
};
|
|
1237
1268
|
```
|
|
1238
1269
|
|
|
1239
|
-
### Extract
|
|
1240
|
-
|
|
1241
|
-
For production builds it's recommended to extract the CSS from your bundle being able to use parallel loading of CSS/JS resources later on.
|
|
1242
|
-
|
|
1243
|
-
- This can be achieved by using the [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) to extract the CSS when running in production mode.
|
|
1244
|
-
|
|
1245
|
-
- As an alternative, if seeking better development performance and css outputs that mimic production. [extract-css-chunks-webpack-plugin](https://github.com/faceyspacey/extract-css-chunks-webpack-plugin) offers a hot module reload friendly, extended version of mini-css-extract-plugin. HMR real CSS files in dev, works like mini-css in non-dev
|
|
1246
|
-
|
|
1247
1270
|
### Pure CSS, CSS modules and PostCSS
|
|
1248
1271
|
|
|
1249
1272
|
When you have pure CSS (without CSS modules), CSS modules and PostCSS in your project you can use this setup:
|
package/dist/index.js
CHANGED
|
@@ -98,8 +98,9 @@ async function loader(content, map, meta) {
|
|
|
98
98
|
|
|
99
99
|
const icssPluginImports = [];
|
|
100
100
|
const icssPluginApi = [];
|
|
101
|
+
const needToUseIcssPlugin = (0, _utils.shouldUseIcssPlugin)(options);
|
|
101
102
|
|
|
102
|
-
if (
|
|
103
|
+
if (needToUseIcssPlugin) {
|
|
103
104
|
const icssResolver = this.getResolve({
|
|
104
105
|
conditionNames: ["style"],
|
|
105
106
|
extensions: [],
|
|
@@ -178,6 +179,6 @@ async function loader(content, map, meta) {
|
|
|
178
179
|
|
|
179
180
|
const importCode = (0, _utils.getImportCode)(imports, options);
|
|
180
181
|
const moduleCode = (0, _utils.getModuleCode)(result, api, replacements, options, this);
|
|
181
|
-
const exportCode = (0, _utils.getExportCode)(exports, replacements, options);
|
|
182
|
+
const exportCode = (0, _utils.getExportCode)(exports, replacements, needToUseIcssPlugin, options);
|
|
182
183
|
callback(null, `${importCode}${moduleCode}${exportCode}`);
|
|
183
184
|
}
|
|
@@ -47,6 +47,12 @@ const plugin = (options = {}) => {
|
|
|
47
47
|
context
|
|
48
48
|
} = options;
|
|
49
49
|
const resolvedUrl = await (0, _utils.resolveRequests)(resolver, context, [...new Set([normalizedUrl, request])]);
|
|
50
|
+
|
|
51
|
+
if (!resolvedUrl) {
|
|
52
|
+
return;
|
|
53
|
+
} // eslint-disable-next-line consistent-return
|
|
54
|
+
|
|
55
|
+
|
|
50
56
|
return {
|
|
51
57
|
url: resolvedUrl,
|
|
52
58
|
prefix,
|
|
@@ -60,12 +66,14 @@ const plugin = (options = {}) => {
|
|
|
60
66
|
const results = await Promise.all(tasks);
|
|
61
67
|
|
|
62
68
|
for (let index = 0; index <= results.length - 1; index++) {
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
+
const item = results[index];
|
|
70
|
+
|
|
71
|
+
if (!item) {
|
|
72
|
+
// eslint-disable-next-line no-continue
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const newUrl = item.prefix ? `${item.prefix}!${item.url}` : item.url;
|
|
69
77
|
const importKey = newUrl;
|
|
70
78
|
let importName = imports.get(importKey);
|
|
71
79
|
|
|
@@ -85,9 +93,9 @@ const plugin = (options = {}) => {
|
|
|
85
93
|
});
|
|
86
94
|
}
|
|
87
95
|
|
|
88
|
-
for (const [replacementIndex, token] of Object.keys(tokens).entries()) {
|
|
96
|
+
for (const [replacementIndex, token] of Object.keys(item.tokens).entries()) {
|
|
89
97
|
const replacementName = `___CSS_LOADER_ICSS_IMPORT_${index}_REPLACEMENT_${replacementIndex}___`;
|
|
90
|
-
const localName = tokens[token];
|
|
98
|
+
const localName = item.tokens[token];
|
|
91
99
|
importReplacements[token] = replacementName;
|
|
92
100
|
options.replacements.push({
|
|
93
101
|
replacementName,
|
|
@@ -19,7 +19,7 @@ function parseNode(atRule, key) {
|
|
|
19
19
|
|
|
20
20
|
if (atRule.raws && atRule.raws.afterName && atRule.raws.afterName.trim().length > 0) {
|
|
21
21
|
const lastCommentIndex = atRule.raws.afterName.lastIndexOf("/*");
|
|
22
|
-
const matched = atRule.raws.afterName.slice(lastCommentIndex).match(_utils.
|
|
22
|
+
const matched = atRule.raws.afterName.slice(lastCommentIndex).match(_utils.WEBPACK_IGNORE_COMMENT_REGEXP);
|
|
23
23
|
|
|
24
24
|
if (matched && matched[2] === "true") {
|
|
25
25
|
return;
|
|
@@ -29,7 +29,7 @@ function parseNode(atRule, key) {
|
|
|
29
29
|
const prevNode = atRule.prev();
|
|
30
30
|
|
|
31
31
|
if (prevNode && prevNode.type === "comment") {
|
|
32
|
-
const matched = prevNode.text.match(_utils.
|
|
32
|
+
const matched = prevNode.text.match(_utils.WEBPACK_IGNORE_COMMENT_REGEXP);
|
|
33
33
|
|
|
34
34
|
if (matched && matched[2] === "true") {
|
|
35
35
|
return;
|
|
@@ -155,12 +155,10 @@ const plugin = (options = {}) => {
|
|
|
155
155
|
const needKeep = await options.filter(url, media);
|
|
156
156
|
|
|
157
157
|
if (!needKeep) {
|
|
158
|
-
return
|
|
158
|
+
return;
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
atRule.remove();
|
|
163
|
-
|
|
164
162
|
if (isRequestable) {
|
|
165
163
|
const request = (0, _utils.requestify)(url, options.rootContext);
|
|
166
164
|
const {
|
|
@@ -168,6 +166,13 @@ const plugin = (options = {}) => {
|
|
|
168
166
|
context
|
|
169
167
|
} = options;
|
|
170
168
|
const resolvedUrl = await (0, _utils.resolveRequests)(resolver, context, [...new Set([request, url])]);
|
|
169
|
+
|
|
170
|
+
if (!resolvedUrl) {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
atRule.remove(); // eslint-disable-next-line consistent-return
|
|
175
|
+
|
|
171
176
|
return {
|
|
172
177
|
url: resolvedUrl,
|
|
173
178
|
media,
|
|
@@ -176,6 +181,8 @@ const plugin = (options = {}) => {
|
|
|
176
181
|
};
|
|
177
182
|
}
|
|
178
183
|
|
|
184
|
+
atRule.remove(); // eslint-disable-next-line consistent-return
|
|
185
|
+
|
|
179
186
|
return {
|
|
180
187
|
url,
|
|
181
188
|
media,
|
|
@@ -45,7 +45,7 @@ function getWebpackIgnoreCommentValue(index, nodes, inBetween) {
|
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
const matched = prevValueNode.value.match(_utils.
|
|
48
|
+
const matched = prevValueNode.value.match(_utils.WEBPACK_IGNORE_COMMENT_REGEXP);
|
|
49
49
|
return matched && matched[2] === "true";
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -74,7 +74,7 @@ function parseDeclaration(declaration, key, result) {
|
|
|
74
74
|
|
|
75
75
|
if (declaration.raws && declaration.raws.between) {
|
|
76
76
|
const lastCommentIndex = declaration.raws.between.lastIndexOf("/*");
|
|
77
|
-
const matched = declaration.raws.between.slice(lastCommentIndex).match(_utils.
|
|
77
|
+
const matched = declaration.raws.between.slice(lastCommentIndex).match(_utils.WEBPACK_IGNORE_COMMENT_REGEXP);
|
|
78
78
|
|
|
79
79
|
if (matched) {
|
|
80
80
|
inBetween = matched[2] === "true";
|
|
@@ -85,7 +85,7 @@ function parseDeclaration(declaration, key, result) {
|
|
|
85
85
|
const prevNode = declaration.prev();
|
|
86
86
|
|
|
87
87
|
if (prevNode && prevNode.type === "comment") {
|
|
88
|
-
const matched = prevNode.text.match(_utils.
|
|
88
|
+
const matched = prevNode.text.match(_utils.WEBPACK_IGNORE_COMMENT_REGEXP);
|
|
89
89
|
|
|
90
90
|
if (matched) {
|
|
91
91
|
isIgnoreOnDeclaration = matched[2] === "true";
|
|
@@ -268,7 +268,7 @@ const plugin = (options = {}) => {
|
|
|
268
268
|
const needKeep = await options.filter(url);
|
|
269
269
|
|
|
270
270
|
if (!needKeep) {
|
|
271
|
-
return
|
|
271
|
+
return;
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
|
|
@@ -282,18 +282,23 @@ const plugin = (options = {}) => {
|
|
|
282
282
|
context
|
|
283
283
|
} = options;
|
|
284
284
|
const resolvedUrl = await (0, _utils.resolveRequests)(resolver, context, [...new Set([request, url])]);
|
|
285
|
+
|
|
286
|
+
if (!resolvedUrl) {
|
|
287
|
+
return;
|
|
288
|
+
} // eslint-disable-next-line consistent-return
|
|
289
|
+
|
|
290
|
+
|
|
285
291
|
return { ...parsedDeclaration,
|
|
286
292
|
url: resolvedUrl,
|
|
287
293
|
hash
|
|
288
294
|
};
|
|
289
295
|
}));
|
|
290
|
-
const results = await Promise.all(resolvedDeclarations);
|
|
291
296
|
const urlToNameMap = new Map();
|
|
292
297
|
const urlToReplacementMap = new Map();
|
|
293
298
|
let hasUrlImportHelper = false;
|
|
294
299
|
|
|
295
|
-
for (let index = 0; index <=
|
|
296
|
-
const item =
|
|
300
|
+
for (let index = 0; index <= resolvedDeclarations.length - 1; index++) {
|
|
301
|
+
const item = resolvedDeclarations[index];
|
|
297
302
|
|
|
298
303
|
if (!item) {
|
|
299
304
|
// eslint-disable-next-line no-continue
|
|
@@ -8,7 +8,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
8
8
|
|
|
9
9
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
10
10
|
|
|
11
|
-
function _iterableToArrayLimit(arr, i) {
|
|
11
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
12
12
|
|
|
13
13
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
14
|
|
package/dist/utils.js
CHANGED
|
@@ -22,7 +22,8 @@ exports.resolveRequests = resolveRequests;
|
|
|
22
22
|
exports.isUrlRequestable = isUrlRequestable;
|
|
23
23
|
exports.sort = sort;
|
|
24
24
|
exports.combineRequests = combineRequests;
|
|
25
|
-
exports.
|
|
25
|
+
exports.camelCase = camelCase;
|
|
26
|
+
exports.WEBPACK_IGNORE_COMMENT_REGEXP = void 0;
|
|
26
27
|
|
|
27
28
|
var _url = require("url");
|
|
28
29
|
|
|
@@ -38,23 +39,68 @@ var _postcssModulesExtractImports = _interopRequireDefault(require("postcss-modu
|
|
|
38
39
|
|
|
39
40
|
var _postcssModulesScope = _interopRequireDefault(require("postcss-modules-scope"));
|
|
40
41
|
|
|
41
|
-
var _camelcase = _interopRequireDefault(require("camelcase"));
|
|
42
|
-
|
|
43
42
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
44
43
|
|
|
45
44
|
/*
|
|
46
45
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
47
46
|
Author Tobias Koppers @sokra
|
|
48
47
|
*/
|
|
49
|
-
const
|
|
50
|
-
const unescapeRegExp = new RegExp(`\\\\([\\da-f]{1,6}${whitespace}?|(${whitespace})|.)`, "ig");
|
|
51
|
-
const matchNativeWin32Path = /^[A-Z]:[/\\]|^\\\\/i;
|
|
52
|
-
const webpackIgnoreCommentRegexp = /webpackIgnore:(\s+)?(true|false)/; // eslint-disable-next-line no-useless-escape
|
|
48
|
+
const WEBPACK_IGNORE_COMMENT_REGEXP = /webpackIgnore:(\s+)?(true|false)/; // eslint-disable-next-line no-useless-escape
|
|
53
49
|
|
|
54
|
-
exports.
|
|
50
|
+
exports.WEBPACK_IGNORE_COMMENT_REGEXP = WEBPACK_IGNORE_COMMENT_REGEXP;
|
|
55
51
|
const regexSingleEscape = /[ -,.\/:-@[\]\^`{-~]/;
|
|
56
52
|
const regexExcessiveSpaces = /(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g;
|
|
57
53
|
|
|
54
|
+
const preserveCamelCase = string => {
|
|
55
|
+
let result = string;
|
|
56
|
+
let isLastCharLower = false;
|
|
57
|
+
let isLastCharUpper = false;
|
|
58
|
+
let isLastLastCharUpper = false;
|
|
59
|
+
|
|
60
|
+
for (let i = 0; i < result.length; i++) {
|
|
61
|
+
const character = result[i];
|
|
62
|
+
|
|
63
|
+
if (isLastCharLower && /[\p{Lu}]/u.test(character)) {
|
|
64
|
+
result = `${result.slice(0, i)}-${result.slice(i)}`;
|
|
65
|
+
isLastCharLower = false;
|
|
66
|
+
isLastLastCharUpper = isLastCharUpper;
|
|
67
|
+
isLastCharUpper = true;
|
|
68
|
+
i += 1;
|
|
69
|
+
} else if (isLastCharUpper && isLastLastCharUpper && /[\p{Ll}]/u.test(character)) {
|
|
70
|
+
result = `${result.slice(0, i - 1)}-${result.slice(i - 1)}`;
|
|
71
|
+
isLastLastCharUpper = isLastCharUpper;
|
|
72
|
+
isLastCharUpper = false;
|
|
73
|
+
isLastCharLower = true;
|
|
74
|
+
} else {
|
|
75
|
+
isLastCharLower = character.toLowerCase() === character && character.toUpperCase() !== character;
|
|
76
|
+
isLastLastCharUpper = isLastCharUpper;
|
|
77
|
+
isLastCharUpper = character.toUpperCase() === character && character.toLowerCase() !== character;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return result;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
function camelCase(input) {
|
|
85
|
+
let result = input.trim();
|
|
86
|
+
|
|
87
|
+
if (result.length === 0) {
|
|
88
|
+
return "";
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (result.length === 1) {
|
|
92
|
+
return result.toLowerCase();
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const hasUpperCase = result !== result.toLowerCase();
|
|
96
|
+
|
|
97
|
+
if (hasUpperCase) {
|
|
98
|
+
result = preserveCamelCase(result);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return result.replace(/^[_.\- ]+/, "").toLowerCase().replace(/[_.\- ]+([\p{Alpha}\p{N}_]|$)/gu, (_, p1) => p1.toUpperCase()).replace(/\d+([\p{Alpha}\p{N}_]|$)/gu, m => m.toUpperCase());
|
|
102
|
+
}
|
|
103
|
+
|
|
58
104
|
function escape(string) {
|
|
59
105
|
let output = "";
|
|
60
106
|
let counter = 0;
|
|
@@ -99,20 +145,87 @@ function escape(string) {
|
|
|
99
145
|
return output;
|
|
100
146
|
}
|
|
101
147
|
|
|
148
|
+
function gobbleHex(str) {
|
|
149
|
+
const lower = str.toLowerCase();
|
|
150
|
+
let hex = "";
|
|
151
|
+
let spaceTerminated = false; // eslint-disable-next-line no-undefined
|
|
152
|
+
|
|
153
|
+
for (let i = 0; i < 6 && lower[i] !== undefined; i++) {
|
|
154
|
+
const code = lower.charCodeAt(i); // check to see if we are dealing with a valid hex char [a-f|0-9]
|
|
155
|
+
|
|
156
|
+
const valid = code >= 97 && code <= 102 || code >= 48 && code <= 57; // https://drafts.csswg.org/css-syntax/#consume-escaped-code-point
|
|
157
|
+
|
|
158
|
+
spaceTerminated = code === 32;
|
|
159
|
+
|
|
160
|
+
if (!valid) {
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
hex += lower[i];
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
if (hex.length === 0) {
|
|
168
|
+
// eslint-disable-next-line no-undefined
|
|
169
|
+
return undefined;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
const codePoint = parseInt(hex, 16);
|
|
173
|
+
const isSurrogate = codePoint >= 0xd800 && codePoint <= 0xdfff; // Add special case for
|
|
174
|
+
// "If this number is zero, or is for a surrogate, or is greater than the maximum allowed code point"
|
|
175
|
+
// https://drafts.csswg.org/css-syntax/#maximum-allowed-code-point
|
|
176
|
+
|
|
177
|
+
if (isSurrogate || codePoint === 0x0000 || codePoint > 0x10ffff) {
|
|
178
|
+
return ["\uFFFD", hex.length + (spaceTerminated ? 1 : 0)];
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
return [String.fromCodePoint(codePoint), hex.length + (spaceTerminated ? 1 : 0)];
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
const CONTAINS_ESCAPE = /\\/;
|
|
185
|
+
|
|
102
186
|
function unescape(str) {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
187
|
+
const needToProcess = CONTAINS_ESCAPE.test(str);
|
|
188
|
+
|
|
189
|
+
if (!needToProcess) {
|
|
190
|
+
return str;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
let ret = "";
|
|
194
|
+
|
|
195
|
+
for (let i = 0; i < str.length; i++) {
|
|
196
|
+
if (str[i] === "\\") {
|
|
197
|
+
const gobbled = gobbleHex(str.slice(i + 1, i + 7)); // eslint-disable-next-line no-undefined
|
|
198
|
+
|
|
199
|
+
if (gobbled !== undefined) {
|
|
200
|
+
ret += gobbled[0];
|
|
201
|
+
i += gobbled[1]; // eslint-disable-next-line no-continue
|
|
202
|
+
|
|
203
|
+
continue;
|
|
204
|
+
} // Retain a pair of \\ if double escaped `\\\\`
|
|
205
|
+
// https://github.com/postcss/postcss-selector-parser/commit/268c9a7656fb53f543dc620aa5b73a30ec3ff20e
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
if (str[i + 1] === "\\") {
|
|
209
|
+
ret += "\\";
|
|
210
|
+
i += 1; // eslint-disable-next-line no-continue
|
|
211
|
+
|
|
212
|
+
continue;
|
|
213
|
+
} // if \\ is at the end of the string retain it
|
|
214
|
+
// https://github.com/postcss/postcss-selector-parser/commit/01a6b346e3612ce1ab20219acc26abdc259ccefb
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
if (str.length === i + 1) {
|
|
218
|
+
ret += str[i];
|
|
219
|
+
} // eslint-disable-next-line no-continue
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
ret += str[i];
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
return ret;
|
|
116
229
|
}
|
|
117
230
|
|
|
118
231
|
function normalizePath(file) {
|
|
@@ -144,6 +257,8 @@ function defaultGetLocalIdent(loaderContext, localIdentName, localName, options)
|
|
|
144
257
|
return (0, _loaderUtils.interpolateName)(loaderContext, localIdentName, options);
|
|
145
258
|
}
|
|
146
259
|
|
|
260
|
+
const NATIVE_WIN32_PATH = /^[A-Z]:[/\\]|^\\\\/i;
|
|
261
|
+
|
|
147
262
|
function normalizeUrl(url, isStringValue) {
|
|
148
263
|
let normalizedUrl = url.replace(/^( |\t\n|\r\n|\r|\f)*/g, "").replace(/( |\t\n|\r\n|\r|\f)*$/g, "");
|
|
149
264
|
|
|
@@ -151,7 +266,7 @@ function normalizeUrl(url, isStringValue) {
|
|
|
151
266
|
normalizedUrl = normalizedUrl.replace(/\\(\n|\r\n|\r|\f)/g, "");
|
|
152
267
|
}
|
|
153
268
|
|
|
154
|
-
if (
|
|
269
|
+
if (NATIVE_WIN32_PATH.test(url)) {
|
|
155
270
|
try {
|
|
156
271
|
normalizedUrl = decodeURI(normalizedUrl);
|
|
157
272
|
} catch (error) {// Ignore
|
|
@@ -193,7 +308,7 @@ function getValidLocalName(localName, exportLocalsConvention) {
|
|
|
193
308
|
return dashesCamelCase(localName);
|
|
194
309
|
}
|
|
195
310
|
|
|
196
|
-
return (
|
|
311
|
+
return camelCase(localName);
|
|
197
312
|
}
|
|
198
313
|
|
|
199
314
|
const moduleRegExp = /\.module(s)?\.\w+$/i;
|
|
@@ -560,13 +675,19 @@ function dashesCamelCase(str) {
|
|
|
560
675
|
return str.replace(/-+(\w)/g, (match, firstLetter) => firstLetter.toUpperCase());
|
|
561
676
|
}
|
|
562
677
|
|
|
563
|
-
function getExportCode(exports, replacements, options) {
|
|
678
|
+
function getExportCode(exports, replacements, needToUseIcssPlugin, options) {
|
|
564
679
|
let code = "// Exports\n";
|
|
680
|
+
|
|
681
|
+
if (!needToUseIcssPlugin) {
|
|
682
|
+
code += `${options.esModule ? "export default" : "module.exports ="} ___CSS_LOADER_EXPORT___;\n`;
|
|
683
|
+
return code;
|
|
684
|
+
}
|
|
685
|
+
|
|
565
686
|
let localsCode = "";
|
|
566
687
|
|
|
567
688
|
const addExportToLocalsCode = (name, value) => {
|
|
568
689
|
if (options.modules.namedExport) {
|
|
569
|
-
localsCode += `export
|
|
690
|
+
localsCode += `export var ${name} = ${JSON.stringify(value)};\n`;
|
|
570
691
|
} else {
|
|
571
692
|
if (localsCode) {
|
|
572
693
|
localsCode += `,\n`;
|
|
@@ -584,7 +705,7 @@ function getExportCode(exports, replacements, options) {
|
|
|
584
705
|
case "camelCase":
|
|
585
706
|
{
|
|
586
707
|
addExportToLocalsCode(name, value);
|
|
587
|
-
const modifiedName = (
|
|
708
|
+
const modifiedName = camelCase(name);
|
|
588
709
|
|
|
589
710
|
if (modifiedName !== name) {
|
|
590
711
|
addExportToLocalsCode(modifiedName, value);
|
|
@@ -595,7 +716,7 @@ function getExportCode(exports, replacements, options) {
|
|
|
595
716
|
|
|
596
717
|
case "camelCaseOnly":
|
|
597
718
|
{
|
|
598
|
-
addExportToLocalsCode((
|
|
719
|
+
addExportToLocalsCode(camelCase(name), value);
|
|
599
720
|
break;
|
|
600
721
|
}
|
|
601
722
|
|
|
@@ -653,10 +774,7 @@ function getExportCode(exports, replacements, options) {
|
|
|
653
774
|
return code;
|
|
654
775
|
}
|
|
655
776
|
|
|
656
|
-
|
|
657
|
-
code += options.modules.namedExport ? localsCode : `___CSS_LOADER_EXPORT___.locals = {\n${localsCode}\n};\n`;
|
|
658
|
-
}
|
|
659
|
-
|
|
777
|
+
code += options.modules.namedExport ? localsCode : `___CSS_LOADER_EXPORT___.locals = {${localsCode ? `\n${localsCode}\n` : ""}};\n`;
|
|
660
778
|
code += `${options.esModule ? "export default" : "module.exports ="} ___CSS_LOADER_EXPORT___;\n`;
|
|
661
779
|
return code;
|
|
662
780
|
}
|
|
@@ -685,7 +803,7 @@ function isUrlRequestable(url) {
|
|
|
685
803
|
} // Absolute URLs
|
|
686
804
|
|
|
687
805
|
|
|
688
|
-
if (/^[a-z][a-z0-9+.-]*:/i.test(url) && !
|
|
806
|
+
if (/^[a-z][a-z0-9+.-]*:/i.test(url) && !NATIVE_WIN32_PATH.test(url)) {
|
|
689
807
|
return false;
|
|
690
808
|
} // `#` URLs
|
|
691
809
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "css-loader",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.6",
|
|
4
4
|
"description": "css loader module for webpack",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "webpack-contrib/css-loader",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"build": "cross-env NODE_ENV=production babel src -d dist --copy-files",
|
|
24
24
|
"postbuild": "npm run validate:runtime",
|
|
25
25
|
"commitlint": "commitlint --from=master",
|
|
26
|
-
"security": "npm audit",
|
|
26
|
+
"security": "npm audit --production",
|
|
27
27
|
"lint:prettier": "prettier --list-different .",
|
|
28
28
|
"lint:js": "eslint --cache .",
|
|
29
29
|
"lint": "npm-run-all -l -p \"lint:**\"",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"test:coverage": "npm run test:only -- --collectCoverageFrom=\"src/**/*.js\" --coverage",
|
|
33
33
|
"pretest": "npm run lint",
|
|
34
34
|
"test": "npm run test:coverage",
|
|
35
|
-
"prepare": "npm run build",
|
|
35
|
+
"prepare": "husky install && npm run build",
|
|
36
36
|
"release": "standard-version"
|
|
37
37
|
},
|
|
38
38
|
"files": [
|
|
@@ -42,10 +42,9 @@
|
|
|
42
42
|
"webpack": "^4.27.0 || ^5.0.0"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"camelcase": "^6.2.0",
|
|
46
45
|
"icss-utils": "^5.1.0",
|
|
47
46
|
"loader-utils": "^2.0.0",
|
|
48
|
-
"postcss": "^8.2.
|
|
47
|
+
"postcss": "^8.2.15",
|
|
49
48
|
"postcss-modules-extract-imports": "^3.0.0",
|
|
50
49
|
"postcss-modules-local-by-default": "^4.0.0",
|
|
51
50
|
"postcss-modules-scope": "^3.0.0",
|
|
@@ -55,41 +54,41 @@
|
|
|
55
54
|
"semver": "^7.3.5"
|
|
56
55
|
},
|
|
57
56
|
"devDependencies": {
|
|
58
|
-
"@babel/cli": "^7.
|
|
59
|
-
"@babel/core": "^7.
|
|
60
|
-
"@babel/preset-env": "^7.
|
|
61
|
-
"@commitlint/cli": "^12.1.
|
|
62
|
-
"@commitlint/config-conventional": "^12.1.
|
|
57
|
+
"@babel/cli": "^7.14.3",
|
|
58
|
+
"@babel/core": "^7.14.3",
|
|
59
|
+
"@babel/preset-env": "^7.14.2",
|
|
60
|
+
"@commitlint/cli": "^12.1.4",
|
|
61
|
+
"@commitlint/config-conventional": "^12.1.4",
|
|
63
62
|
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
|
|
64
63
|
"babel-jest": "^26.6.3",
|
|
65
64
|
"cross-env": "^7.0.3",
|
|
66
65
|
"del": "^6.0.0",
|
|
67
66
|
"del-cli": "^3.0.1",
|
|
68
67
|
"es-check": "^5.2.3",
|
|
69
|
-
"eslint": "^7.
|
|
70
|
-
"eslint-config-prettier": "^8.
|
|
71
|
-
"eslint-plugin-import": "^2.
|
|
68
|
+
"eslint": "^7.26.0",
|
|
69
|
+
"eslint-config-prettier": "^8.3.0",
|
|
70
|
+
"eslint-plugin-import": "^2.23.2",
|
|
72
71
|
"file-loader": "^6.2.0",
|
|
73
|
-
"husky": "^
|
|
72
|
+
"husky": "^6.0.0",
|
|
74
73
|
"jest": "^26.6.3",
|
|
75
74
|
"less": "^4.1.1",
|
|
76
75
|
"less-loader": "^7.1.0",
|
|
77
|
-
"lint-staged": "^
|
|
76
|
+
"lint-staged": "^11.0.0",
|
|
78
77
|
"memfs": "^3.2.2",
|
|
79
|
-
"mini-css-extract-plugin": "^1.
|
|
78
|
+
"mini-css-extract-plugin": "^1.6.0",
|
|
80
79
|
"npm-run-all": "^4.1.5",
|
|
81
|
-
"postcss-loader": "^4.0
|
|
80
|
+
"postcss-loader": "^4.3.0",
|
|
82
81
|
"postcss-preset-env": "^6.7.0",
|
|
83
|
-
"prettier": "^2.
|
|
84
|
-
"sass": "^1.32.
|
|
85
|
-
"sass-loader": "^10.
|
|
86
|
-
"standard-version": "^9.
|
|
82
|
+
"prettier": "^2.3.0",
|
|
83
|
+
"sass": "^1.32.13",
|
|
84
|
+
"sass-loader": "^10.2.0",
|
|
85
|
+
"standard-version": "^9.3.0",
|
|
87
86
|
"strip-ansi": "^6.0.0",
|
|
88
87
|
"style-loader": "^2.0.0",
|
|
89
88
|
"stylus": "^0.54.8",
|
|
90
|
-
"stylus-loader": "^4.3.
|
|
89
|
+
"stylus-loader": "^4.3.3",
|
|
91
90
|
"url-loader": "^4.1.1",
|
|
92
|
-
"webpack": "^5.
|
|
91
|
+
"webpack": "^5.37.1"
|
|
93
92
|
},
|
|
94
93
|
"keywords": [
|
|
95
94
|
"webpack",
|
package/CHANGELOG.md
DELETED
|
@@ -1,618 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
|
-
|
|
5
|
-
### [5.2.2](https://github.com/webpack-contrib/css-loader/compare/v5.2.1...v5.2.2) (2021-04-16)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
### Bug Fixes
|
|
9
|
-
|
|
10
|
-
* avoid escape nonASCII characters in local names ([0722733](https://github.com/webpack-contrib/css-loader/commit/072273308a8ab4b7efdae31440689dc81978ca1d))
|
|
11
|
-
|
|
12
|
-
### [5.2.1](https://github.com/webpack-contrib/css-loader/compare/v5.2.0...v5.2.1) (2021-04-09)
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
### Bug Fixes
|
|
16
|
-
|
|
17
|
-
* do not crash on unescaped svg data uri ([#1288](https://github.com/webpack-contrib/css-loader/issues/1288)) ([4f289c5](https://github.com/webpack-contrib/css-loader/commit/4f289c5e4df6c666fdf6dd3402560ae74d4bf7ee))
|
|
18
|
-
|
|
19
|
-
## [5.2.0](https://github.com/webpack-contrib/css-loader/compare/v5.1.4...v5.2.0) (2021-03-24)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
### Features
|
|
23
|
-
|
|
24
|
-
* support async functions for `url` and `import` options ([#1277](https://github.com/webpack-contrib/css-loader/issues/1277)) ([c5062db](https://github.com/webpack-contrib/css-loader/commit/c5062db3fc849d882a07b9f2c9f66f00325c8896))
|
|
25
|
-
|
|
26
|
-
### [5.1.4](https://github.com/webpack-contrib/css-loader/compare/v5.1.3...v5.1.4) (2021-03-24)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
### Bug Fixes
|
|
30
|
-
|
|
31
|
-
* crash with thread-loader ([#1281](https://github.com/webpack-contrib/css-loader/issues/1281)) ([7095a7c](https://github.com/webpack-contrib/css-loader/commit/7095a7ca7d985d5447aed80cf3e41a4f8c19b954))
|
|
32
|
-
|
|
33
|
-
### [5.1.3](https://github.com/webpack-contrib/css-loader/compare/v5.1.2...v5.1.3) (2021-03-15)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
### Bug Fixes
|
|
37
|
-
|
|
38
|
-
* the `auto` option works using inline module syntax ([#1274](https://github.com/webpack-contrib/css-loader/issues/1274)) ([1db2f4d](https://github.com/webpack-contrib/css-loader/commit/1db2f4df3ff9ae8f0667a2304853c8e7cdd0afc1))
|
|
39
|
-
* ident generation for CSS modules using inline module syntax ([#1274](https://github.com/webpack-contrib/css-loader/issues/1274)) ([1db2f4d](https://github.com/webpack-contrib/css-loader/commit/1db2f4df3ff9ae8f0667a2304853c8e7cdd0afc1))
|
|
40
|
-
|
|
41
|
-
### [5.1.2](https://github.com/webpack-contrib/css-loader/compare/v5.1.1...v5.1.2) (2021-03-10)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
### Bug Fixes
|
|
45
|
-
|
|
46
|
-
* handling `@import` with spaces before and after and any extensions ([#1272](https://github.com/webpack-contrib/css-loader/issues/1272)) ([0c47cf7](https://github.com/webpack-contrib/css-loader/commit/0c47cf7ccbe3635900e8e8840650f69a7eca004d))
|
|
47
|
-
* inline loader syntax in `@import` and modules ([3f49ed0](https://github.com/webpack-contrib/css-loader/commit/3f49ed0864457f9467f560856377c890c392aee7))
|
|
48
|
-
|
|
49
|
-
### [5.1.1](https://github.com/webpack-contrib/css-loader/compare/v5.1.0...v5.1.1) (2021-03-01)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
### Bug Fixes
|
|
53
|
-
|
|
54
|
-
* crash on modified AST from `postcss-loader` ([#1268](https://github.com/webpack-contrib/css-loader/issues/1268)) ([d2a1a84](https://github.com/webpack-contrib/css-loader/commit/d2a1a84afc63fdfb2a4ce6668ed9f2d7f1ba56ca))
|
|
55
|
-
|
|
56
|
-
## [5.1.0](https://github.com/webpack-contrib/css-loader/compare/v5.0.2...v5.1.0) (2021-02-25)
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
### Features
|
|
60
|
-
|
|
61
|
-
* added support webpackIgnore comment ([#1264](https://github.com/webpack-contrib/css-loader/issues/1264)) ([53d40a9](https://github.com/webpack-contrib/css-loader/commit/53d40a9bb35a79e6a15308bbb7a01358f39816df))
|
|
62
|
-
|
|
63
|
-
### [5.0.2](https://github.com/webpack-contrib/css-loader/compare/v5.0.1...v5.0.2) (2021-02-08)
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
### Bug Fixes
|
|
67
|
-
|
|
68
|
-
* pass query with hash to other loaders ([#1261](https://github.com/webpack-contrib/css-loader/issues/1261)) ([729a314](https://github.com/webpack-contrib/css-loader/commit/729a314529cd0607c374b07bdf425337f9a778d4))
|
|
69
|
-
|
|
70
|
-
### [5.0.1](https://github.com/webpack-contrib/css-loader/compare/v5.0.0...v5.0.1) (2020-11-04)
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
### Bug Fixes
|
|
74
|
-
|
|
75
|
-
* sources in source maps have relative paths ([#1219](https://github.com/webpack-contrib/css-loader/issues/1219)) ([3229b3c](https://github.com/webpack-contrib/css-loader/commit/3229b3cca3cb5d762daeff57239a965b06fd7593))
|
|
76
|
-
|
|
77
|
-
## [5.0.0](https://github.com/webpack-contrib/css-loader/compare/v4.3.0...v5.0.0) (2020-10-13)
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
### ⚠ BREAKING CHANGES
|
|
81
|
-
|
|
82
|
-
* migrate on PostCSS 8
|
|
83
|
-
* runtime doesn't contain source maps code without `sourceMap: true`
|
|
84
|
-
* returned value from the `getLocalIdent` escapes by default, the `exportName` value is always unescaped
|
|
85
|
-
* Auto enable icss modules for all files for which `/\.icss\.\w+$/i` (the `modules.compileType` option is `icss`)
|
|
86
|
-
* `[emoji]` placeholder was deprecated
|
|
87
|
-
* `icss` option was removed (it was deprecated previously)
|
|
88
|
-
|
|
89
|
-
### Features
|
|
90
|
-
|
|
91
|
-
* allow named exports to have underscores in names ([#1209](https://github.com/webpack-contrib/css-loader/issues/1209)) ([747d62b](https://github.com/webpack-contrib/css-loader/commit/747d62b75a878d8881f4819b96297667dc689b8f))
|
|
92
|
-
* hide warning when you don't need handle `url()`/`@import` ([#1195](https://github.com/webpack-contrib/css-loader/issues/1195)) ([dd52931](https://github.com/webpack-contrib/css-loader/commit/dd52931150ed42f122d9017642437c26cc1b2422))
|
|
93
|
-
* improve error message ([52412f6](https://github.com/webpack-contrib/css-loader/commit/52412f6d5a54745ee37a4a67f038455c26ba5772))
|
|
94
|
-
* reduce runtime ([9f974be](https://github.com/webpack-contrib/css-loader/commit/9f974be81f5942d3afaf783529677bd541952fa3))
|
|
95
|
-
* add fallback if custom getLocalIdent returns `null`/`undefined` ([#1193](https://github.com/webpack-contrib/css-loader/issues/1193)) ([0f95841](https://github.com/webpack-contrib/css-loader/commit/0f9584135e63f9f354043e7f414e0c1aad0edc6e))
|
|
96
|
-
|
|
97
|
-
## [4.3.0](https://github.com/webpack-contrib/css-loader/compare/v4.2.2...v4.3.0) (2020-09-08)
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
### Features
|
|
101
|
-
|
|
102
|
-
* the `importLoaders` can be `string` ([#1178](https://github.com/webpack-contrib/css-loader/issues/1178)) ([ec58a7c](https://github.com/webpack-contrib/css-loader/commit/ec58a7cfda46443e35539d66b86685195fa5db03))
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
### Bug Fixes
|
|
106
|
-
|
|
107
|
-
* line breaks in `url` function ([88b8ddc](https://github.com/webpack-contrib/css-loader/commit/88b8ddc1d78a2b6a917ed2dfe2f2a37cf6a84190))
|
|
108
|
-
|
|
109
|
-
### [4.2.2](https://github.com/webpack-contrib/css-loader/compare/v4.2.1...v4.2.2) (2020-08-24)
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
### Bug Fixes
|
|
113
|
-
|
|
114
|
-
* source maps generation, source from source maps are now relative to `compiler.context` and use `webpack://` protocol ([#1169](https://github.com/webpack-contrib/css-loader/issues/1169)) ([fb5c53d](https://github.com/webpack-contrib/css-loader/commit/fb5c53d80b10ee698762238bb7b122aec8c5048d))
|
|
115
|
-
|
|
116
|
-
### [4.2.1](https://github.com/webpack-contrib/css-loader/compare/v4.2.0...v4.2.1) (2020-08-06)
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
### Bug Fixes
|
|
120
|
-
|
|
121
|
-
* regression with the `exportOnlyLocals` option, now `locals` are not exported under the `locals` name, it was big regression, we apologize for that ([24c0a12](https://github.com/webpack-contrib/css-loader/commit/24c0a122d1396c08326a24f6184f5da09cf52ccc))
|
|
122
|
-
|
|
123
|
-
## [4.2.0](https://github.com/webpack-contrib/css-loader/compare/v4.1.1...v4.2.0) (2020-07-31)
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
### Features
|
|
127
|
-
|
|
128
|
-
* add `module.type` option, the `icss` option is deprecated ([#1150](https://github.com/webpack-contrib/css-loader/issues/1150)) ([68f72af](https://github.com/webpack-contrib/css-loader/commit/68f72af2a09111f74dcacbf7af019fe7eb40cb6c))
|
|
129
|
-
|
|
130
|
-
### [4.1.1](https://github.com/webpack-contrib/css-loader/compare/v4.1.0...v4.1.1) (2020-07-30)
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
### Bug Fixes
|
|
134
|
-
|
|
135
|
-
* remove unnecessary `console` call ([#1148](https://github.com/webpack-contrib/css-loader/issues/1148)) ([b1b90ca](https://github.com/webpack-contrib/css-loader/commit/b1b90caaea8eb045177749729340c7906454a84b))
|
|
136
|
-
|
|
137
|
-
## [4.1.0](https://github.com/webpack-contrib/css-loader/compare/v4.0.0...v4.1.0) (2020-07-29)
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
### Features
|
|
141
|
-
|
|
142
|
-
* add `icss` option ([#1140](https://github.com/webpack-contrib/css-loader/issues/1140)) ([a8ec7da](https://github.com/webpack-contrib/css-loader/commit/a8ec7da42234e0b2eb061d2a920669940bcbdf05))
|
|
143
|
-
* support absolute paths ([f9ba0ce](https://github.com/webpack-contrib/css-loader/commit/f9ba0ce11789770c4c9220478e9c98dbd432a5d6))
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
### Bug Fixes
|
|
147
|
-
|
|
148
|
-
* do not crash with `data` URLs ([#1142](https://github.com/webpack-contrib/css-loader/issues/1142)) ([91bc64b](https://github.com/webpack-contrib/css-loader/commit/91bc64b81abfeffd174639a8fdf2366412c11426))
|
|
149
|
-
* performance ([#1144](https://github.com/webpack-contrib/css-loader/issues/1144)) ([4f1baa2](https://github.com/webpack-contrib/css-loader/commit/4f1baa211eb27b0b281ba9f262fa12e8aaefc0ba))
|
|
150
|
-
|
|
151
|
-
## [4.0.0](https://github.com/webpack-contrib/css-loader/compare/v3.6.0...v4.0.0) (2020-07-25)
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
### ⚠ BREAKING CHANGES
|
|
155
|
-
|
|
156
|
-
* minimum required `Node.js` version is `10.13.0`
|
|
157
|
-
* minimum required `webpack` version is `4.27.0`
|
|
158
|
-
* the `esModule` option is `true` by default
|
|
159
|
-
* default value of the `sourceMap` option depends on the `devtool` option
|
|
160
|
-
* `icss` plugin disable by default, you need to setup the `modules` option to enable it
|
|
161
|
-
* the `modules` option is `true` by default for all files matching `/\.module\.\w+$/i.test(filename)` regular expression, `module.auto` is `true` by default
|
|
162
|
-
* the `modules.context` option was renamed to the `modules.localIdentContext` option
|
|
163
|
-
* default the `modules.localIdentContext` value is `compiler.context` for the `module.getLocalIdent` option
|
|
164
|
-
* the `modules.hashPrefix` option was renamed to the `modules.localIdentHashPrefix` option
|
|
165
|
-
* the `localsConvention` option was moved and renamed to the `modules.exportLocalsConvention` option
|
|
166
|
-
* the `getLocalIndent` option should be always `Function` and should always return `String` value
|
|
167
|
-
* the `onlyLocals` option was moved and renamed to the `modules.exportOnlyLocals` option
|
|
168
|
-
* function arguments of the `import` option were changed, it is now `function(url, media, resourcePath) {}`
|
|
169
|
-
* inline syntax was changed, please write `~` before the file request, i.e. rewrite `url(~!!loader!package/img.png)` to `url(!!loader!~package/img.png)`
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
### Features
|
|
173
|
-
|
|
174
|
-
* `@value` supports importing `url()` ([#1126](https://github.com/webpack-contrib/css-loader/issues/1126)) ([7f49a0a](https://github.com/webpack-contrib/css-loader/commit/7f49a0a6047846bb2e432558365e19d4a0dfb366))
|
|
175
|
-
* improve `url()` resolving algorithm ([bc19ddd](https://github.com/webpack-contrib/css-loader/commit/bc19ddd8779dafbc2a420870a3cb841041ce9c7c))
|
|
176
|
-
* named export for locals ([#1108](https://github.com/webpack-contrib/css-loader/issues/1108)) ([d139ec1](https://github.com/webpack-contrib/css-loader/commit/d139ec1d763f9944550b31f2a75183e488dd1224))
|
|
177
|
-
* respected the `style` field from package.json ([#1099](https://github.com/webpack-contrib/css-loader/issues/1099)) ([edf5347](https://github.com/webpack-contrib/css-loader/commit/edf5347e4203a62e50b87248a83da198afdc6eba))
|
|
178
|
-
* support `file:` protocol ([5604205](https://github.com/webpack-contrib/css-loader/commit/560420567eb0e1a635648b7f4ff0365db475384c))
|
|
179
|
-
* support server relative URLs
|
|
180
|
-
|
|
181
|
-
### Bug Fixes
|
|
182
|
-
|
|
183
|
-
* resolution algorithm, you don't need `~` inside packages in `node_modules` ([76f1480](https://github.com/webpack-contrib/css-loader/commit/76f1480b14265369ac5dc8dbbce467cfb8e814c5))
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
## [3.6.0](https://github.com/webpack-contrib/css-loader/compare/v3.5.3...v3.6.0) (2020-06-13)
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
### Features
|
|
190
|
-
|
|
191
|
-
* allow `modules.auto` to be a filter function ([#1086](https://github.com/webpack-contrib/css-loader/issues/1086)) ([0902353](https://github.com/webpack-contrib/css-loader/commit/0902353c328d4d18e8ed2755fe9c83c03c53df81))
|
|
192
|
-
|
|
193
|
-
### [3.5.3](https://github.com/webpack-contrib/css-loader/compare/v3.5.2...v3.5.3) (2020-04-24)
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
### Bug Fixes
|
|
197
|
-
|
|
198
|
-
* add file from an error to file dependencies ([841423f](https://github.com/webpack-contrib/css-loader/commit/841423fca2932c18f8ac0cf0a1f0012fc0a62fb6))
|
|
199
|
-
* avoid query string in source maps ([#1082](https://github.com/webpack-contrib/css-loader/issues/1082)) ([f64de13](https://github.com/webpack-contrib/css-loader/commit/f64de13f7377eff9501348cf26213212ca696913))
|
|
200
|
-
|
|
201
|
-
### [3.5.2](https://github.com/webpack-contrib/css-loader/compare/v3.5.1...v3.5.2) (2020-04-10)
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
### Bug Fixes
|
|
205
|
-
|
|
206
|
-
* schema for the `modules.auto` option ([#1075](https://github.com/webpack-contrib/css-loader/issues/1075)) ([8c9ffe7](https://github.com/webpack-contrib/css-loader/commit/8c9ffe7c6df11232b63173c757baa71ed36f6145))
|
|
207
|
-
|
|
208
|
-
### [3.5.1](https://github.com/webpack-contrib/css-loader/compare/v3.5.0...v3.5.1) (2020-04-07)
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
### Bug Fixes
|
|
212
|
-
|
|
213
|
-
* don't generate an invalid code for `locals` ([#1072](https://github.com/webpack-contrib/css-loader/issues/1072)) ([866b84a](https://github.com/webpack-contrib/css-loader/commit/866b84acd7fd47651f741ca1e6cf7081c2bbe357))
|
|
214
|
-
|
|
215
|
-
## [3.5.0](https://github.com/webpack-contrib/css-loader/compare/v3.4.2...v3.5.0) (2020-04-06)
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
### Features
|
|
219
|
-
|
|
220
|
-
* accept semver compatible postcss AST ([#1049](https://github.com/webpack-contrib/css-loader/issues/1049)) ([14c4faa](https://github.com/webpack-contrib/css-loader/commit/14c4faae87305c9b965de4f468bb1e118f6b84cc))
|
|
221
|
-
* allow to determinate css modules using the `modules.auto` option, please look at an [example](https://github.com/webpack-contrib/css-loader#pure-css-css-modules-and-postcss) of how you can simplify the configuration. ([#1067](https://github.com/webpack-contrib/css-loader/issues/1067)) ([c673cf4](https://github.com/webpack-contrib/css-loader/commit/c673cf418e901c5050bc697eb45401dc9a42c477))
|
|
222
|
-
* the `modules.exportGlobals` option for export global classes and ids ([#1069](https://github.com/webpack-contrib/css-loader/issues/1069)) ([519e5f4](https://github.com/webpack-contrib/css-loader/commit/519e5f41539f4c87ec96db0a908aaadecc284a6c))
|
|
223
|
-
* the `modules.mode` option may be a function ([#1065](https://github.com/webpack-contrib/css-loader/issues/1065)) ([0d8ac3b](https://github.com/webpack-contrib/css-loader/commit/0d8ac3bcb831bc747657c914aba106b93840737e))
|
|
224
|
-
|
|
225
|
-
### [3.4.2](https://github.com/webpack-contrib/css-loader/compare/v3.4.1...v3.4.2) (2020-01-10)
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
### Bug Fixes
|
|
229
|
-
|
|
230
|
-
* do not duplicate css on `composes` ([#1040](https://github.com/webpack-contrib/css-loader/issues/1040)) ([df79602](https://github.com/webpack-contrib/css-loader/commit/df7960277be20ec80e9be1a41ac53baf69847fa0))
|
|
231
|
-
|
|
232
|
-
### [3.4.1](https://github.com/webpack-contrib/css-loader/compare/v3.4.0...v3.4.1) (2020-01-03)
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
### Bug Fixes
|
|
236
|
-
|
|
237
|
-
* do not output `undefined` when sourceRoot is unavailable ([#1036](https://github.com/webpack-contrib/css-loader/issues/1036)) ([ded2a79](https://github.com/webpack-contrib/css-loader/commit/ded2a797271f2adf864bf92300621c024974bc79))
|
|
238
|
-
* don't output invalid es5 code when locals do not exists ([#1035](https://github.com/webpack-contrib/css-loader/issues/1035)) ([b60e62a](https://github.com/webpack-contrib/css-loader/commit/b60e62a655719cc1779fae7d577af6ad6cf42135))
|
|
239
|
-
|
|
240
|
-
## [3.4.0](https://github.com/webpack-contrib/css-loader/compare/v3.3.1...v3.4.0) (2019-12-17)
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
### Features
|
|
244
|
-
|
|
245
|
-
* `esModule` option ([#1026](https://github.com/webpack-contrib/css-loader/issues/1026)) ([d358cdb](https://github.com/webpack-contrib/css-loader/commit/d358cdbe2c026afafa0279003cb6c8a3eff4c419))
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
### Bug Fixes
|
|
249
|
-
|
|
250
|
-
* logic for order and media queries for imports ([#1018](https://github.com/webpack-contrib/css-loader/issues/1018)) ([65450d9](https://github.com/webpack-contrib/css-loader/commit/65450d9c04790ccc9fb06eac81ea6d8f3cdbfaac))
|
|
251
|
-
|
|
252
|
-
### [3.3.2](https://github.com/webpack-contrib/css-loader/compare/v3.3.1...v3.3.2) (2019-12-12)
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
### Bug Fixes
|
|
256
|
-
|
|
257
|
-
* logic for order and media queries for imports ([1fb5134](https://github.com/webpack-contrib/css-loader/commit/1fb51340a7719b6f5b517cb71ea85ec5d45c1199))
|
|
258
|
-
|
|
259
|
-
### [3.3.1](https://github.com/webpack-contrib/css-loader/compare/v3.3.0...v3.3.1) (2019-12-12)
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
### Bug Fixes
|
|
263
|
-
|
|
264
|
-
* better handling url functions and an url in `@import` at-rules
|
|
265
|
-
* reduce count of `require` ([#1014](https://github.com/webpack-contrib/css-loader/issues/1014)) ([e091d27](https://github.com/webpack-contrib/css-loader/commit/e091d2709c29ac57ed0106af8ec3b581cbda7a9c))
|
|
266
|
-
|
|
267
|
-
## [3.3.0](https://github.com/webpack-contrib/css-loader/compare/v3.2.1...v3.3.0) (2019-12-09)
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
### Features
|
|
271
|
-
|
|
272
|
-
* support `pure` css modules ([#1008](https://github.com/webpack-contrib/css-loader/issues/1008)) ([6177af5](https://github.com/webpack-contrib/css-loader/commit/6177af5596566fead13a8f66d5abcb4dc2b744db))
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
### Bug Fixes
|
|
276
|
-
|
|
277
|
-
* do not crash when an assert return `null` or `undefined` ([#1006](https://github.com/webpack-contrib/css-loader/issues/1006)) ([6769783](https://github.com/webpack-contrib/css-loader/commit/67697833725e1cff12a14663390bbe4c65ea36d2))
|
|
278
|
-
* reduce count of `require` ([#1004](https://github.com/webpack-contrib/css-loader/issues/1004)) ([80e9662](https://github.com/webpack-contrib/css-loader/commit/80e966280f2477c5c0e4553d3be3a04511fea381))
|
|
279
|
-
|
|
280
|
-
### [3.2.1](https://github.com/webpack-contrib/css-loader/compare/v3.2.0...v3.2.1) (2019-12-02)
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
### Bug Fixes
|
|
284
|
-
|
|
285
|
-
* add an additional space after the escape sequence ([#998](https://github.com/webpack-contrib/css-loader/issues/998)) ([0961304](https://github.com/webpack-contrib/css-loader/commit/0961304020832fc9ca70cc708f4366e1f868e765))
|
|
286
|
-
* compatibility with ES modules syntax and hash in `url` function ([#1001](https://github.com/webpack-contrib/css-loader/issues/1001)) ([8f4d6f5](https://github.com/webpack-contrib/css-loader/commit/8f4d6f508187513347106a436eda993f874065f1))
|
|
287
|
-
|
|
288
|
-
## [3.2.0](https://github.com/webpack-contrib/css-loader/compare/v3.1.0...v3.2.0) (2019-08-06)
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
### Bug Fixes
|
|
292
|
-
|
|
293
|
-
* replace `.` characters in localIndent to `-` character (regression) ([#982](https://github.com/webpack-contrib/css-loader/issues/982)) ([967fb66](https://github.com/webpack-contrib/css-loader/commit/967fb66))
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
### Features
|
|
297
|
-
|
|
298
|
-
* support es modules for assets loader ([#984](https://github.com/webpack-contrib/css-loader/issues/984)) ([9c5126c](https://github.com/webpack-contrib/css-loader/commit/9c5126c))
|
|
299
|
-
|
|
300
|
-
## [3.1.0](https://github.com/webpack-contrib/css-loader/compare/v3.0.0...v3.1.0) (2019-07-18)
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
### Bug Fixes
|
|
304
|
-
|
|
305
|
-
* converting all (including reserved and control) filesystem characters to `-` (it was regression in `3.0.0` version) ([#972](https://github.com/webpack-contrib/css-loader/issues/972)) ([f51859b](https://github.com/webpack-contrib/css-loader/commit/f51859b))
|
|
306
|
-
* default context should be undefined instead of null ([#965](https://github.com/webpack-contrib/css-loader/issues/965)) ([9c32885](https://github.com/webpack-contrib/css-loader/commit/9c32885))
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
### Features
|
|
310
|
-
|
|
311
|
-
* allow `modules.getLocalIdent` to return a falsy value ([#963](https://github.com/webpack-contrib/css-loader/issues/963)) ([9c3571c](https://github.com/webpack-contrib/css-loader/commit/9c3571c))
|
|
312
|
-
* improved validation error messages ([65e4fc0](https://github.com/webpack-contrib/css-loader/commit/65e4fc0))
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
## [3.0.0](https://github.com/webpack-contrib/css-loader/compare/v2.1.1...v3.0.0) (2019-06-11)
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
### Bug Fixes
|
|
320
|
-
|
|
321
|
-
* avoid the "from" argument must be of type string error ([#908](https://github.com/webpack-contrib/css-loader/issues/908)) ([e5dfd23](https://github.com/webpack-contrib/css-loader/commit/e5dfd23))
|
|
322
|
-
* invert `Function` behavior for `url` and `import` options ([#939](https://github.com/webpack-contrib/css-loader/issues/939)) ([e9eb5ad](https://github.com/webpack-contrib/css-loader/commit/e9eb5ad))
|
|
323
|
-
* properly export locals with escaped characters ([#917](https://github.com/webpack-contrib/css-loader/issues/917)) ([a0efcda](https://github.com/webpack-contrib/css-loader/commit/a0efcda))
|
|
324
|
-
* property handle non css characters in localIdentName ([#920](https://github.com/webpack-contrib/css-loader/issues/920)) ([d3a0a3c](https://github.com/webpack-contrib/css-loader/commit/d3a0a3c))
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
### Features
|
|
328
|
-
|
|
329
|
-
* modules options now accepts object config ([#937](https://github.com/webpack-contrib/css-loader/issues/937)) ([1d7a464](https://github.com/webpack-contrib/css-loader/commit/1d7a464))
|
|
330
|
-
* support `@value` at-rule in selectors ([#941](https://github.com/webpack-contrib/css-loader/issues/941)) ([05a42e2](https://github.com/webpack-contrib/css-loader/commit/05a42e2))
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
### BREAKING CHANGES
|
|
334
|
-
|
|
335
|
-
* minimum required nodejs version is 8.9.0
|
|
336
|
-
* `@value` at rules now support in `selector`, recommends checking all `@values` at-rule usage (hint: you can add prefix to all `@value` at-rules, for example `@value v-foo: black;` or `@value m-foo: screen and (max-width: 12450px)`, and then do upgrade)
|
|
337
|
-
* invert `{Function}` behavior for `url` and `import` options (need return `true` when you want handle `url`/`@import` and return `false` if not)
|
|
338
|
-
* `camelCase` option was remove in favor `localsConvention` option, also it is accept only `{String}` value (use `camelCase` value if you previously value was `true` and `asIs` if you previously value was `false`)
|
|
339
|
-
* `exportOnlyLocals` option was remove in favor `onlyLocals` option
|
|
340
|
-
* `modules` option now can be `{Object}` and allow to setup `CSS Modules` options:
|
|
341
|
-
* `localIdentName` option was removed in favor `modules.localIdentName` option
|
|
342
|
-
* `context` option was remove in favor `modules.context` option
|
|
343
|
-
* `hashPrefix` option was removed in favor `modules.hashPrefix` option
|
|
344
|
-
* `getLocalIdent` option was removed in favor `modules.getLocalIdent` option
|
|
345
|
-
* `localIdentRegExp` option was removed in favor `modules.localIdentRegExp` option
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
<a name="2.1.1"></a>
|
|
350
|
-
## [2.1.1](https://github.com/webpack-contrib/css-loader/compare/v2.1.0...v2.1.1) (2019-03-07)
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
### Bug Fixes
|
|
354
|
-
|
|
355
|
-
* do not break selector with escaping ([#896](https://github.com/webpack-contrib/css-loader/issues/896)) ([0ba8c66](https://github.com/webpack-contrib/css-loader/commit/0ba8c66))
|
|
356
|
-
* source map generation when `sourceRoot` is present ([#901](https://github.com/webpack-contrib/css-loader/issues/901)) ([e9ce745](https://github.com/webpack-contrib/css-loader/commit/e9ce745))
|
|
357
|
-
* sourcemap generating when previous loader pass sourcemap as string ([#905](https://github.com/webpack-contrib/css-loader/issues/905)) ([3797e4d](https://github.com/webpack-contrib/css-loader/commit/3797e4d))
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
<a name="2.1.0"></a>
|
|
362
|
-
# [2.1.0](https://github.com/webpack-contrib/css-loader/compare/v2.0.2...v2.1.0) (2018-12-25)
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
### Features
|
|
366
|
-
|
|
367
|
-
* support `image-set` without `url` ([#879](https://github.com/webpack-contrib/css-loader/issues/879)) ([21884e2](https://github.com/webpack-contrib/css-loader/commit/21884e2))
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
<a name="2.0.2"></a>
|
|
372
|
-
## [2.0.2](https://github.com/webpack-contrib/css-loader/compare/v2.0.1...v2.0.2) (2018-12-21)
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
### Bug Fixes
|
|
376
|
-
|
|
377
|
-
* inappropriate modification of animation keywords ([#876](https://github.com/webpack-contrib/css-loader/issues/876)) ([dfb2f8e](https://github.com/webpack-contrib/css-loader/commit/dfb2f8e))
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
<a name="2.0.1"></a>
|
|
382
|
-
# [2.0.1](https://github.com/webpack-contrib/css-loader/compare/v2.0.0...v2.0.1) (2018-12-14)
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
### Bug Fixes
|
|
386
|
-
|
|
387
|
-
* safe checking if params are present for at rule ([#871](https://github.com/webpack-contrib/css-loader/issues/871)) ([a88fed1](https://github.com/webpack-contrib/css-loader/commit/a88fed1))
|
|
388
|
-
* `getLocalIdent` now accepts `false` value ([#865](https://github.com/webpack-contrib/css-loader/issues/865)) ([1825e8a](https://github.com/webpack-contrib/css-loader/commit/1825e8a))
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
<a name="2.0.0"></a>
|
|
393
|
-
# [2.0.0](https://github.com/webpack-contrib/css-loader/compare/v1.0.1...v2.0.0) (2018-12-07)
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
### Bug Fixes
|
|
397
|
-
|
|
398
|
-
* broken unucode characters ([#850](https://github.com/webpack-contrib/css-loader/issues/850)) ([f599c70](https://github.com/webpack-contrib/css-loader/commit/f599c70))
|
|
399
|
-
* correctly processing `urls()` with `?#hash` ([#803](https://github.com/webpack-contrib/css-loader/issues/803)) ([417d105](https://github.com/webpack-contrib/css-loader/commit/417d105))
|
|
400
|
-
* don't break loader on invalid or not exists url or import token ([#827](https://github.com/webpack-contrib/css-loader/issues/827)) ([9e52d26](https://github.com/webpack-contrib/css-loader/commit/9e52d26))
|
|
401
|
-
* don't duplicate import with same media in different case ([#819](https://github.com/webpack-contrib/css-loader/issues/819)) ([9f66e33](https://github.com/webpack-contrib/css-loader/commit/9f66e33))
|
|
402
|
-
* emit warnings on broken `import` at-rules ([#806](https://github.com/webpack-contrib/css-loader/issues/806)) ([4bdf08b](https://github.com/webpack-contrib/css-loader/commit/4bdf08b))
|
|
403
|
-
* handle uppercase `URL` in `import` at-rules ([#818](https://github.com/webpack-contrib/css-loader/issues/818)) ([3ebdcd5](https://github.com/webpack-contrib/css-loader/commit/3ebdcd5))
|
|
404
|
-
* inconsistent generate class names for css modules on difference os ([#812](https://github.com/webpack-contrib/css-loader/issues/812)) ([0bdf9b7](https://github.com/webpack-contrib/css-loader/commit/0bdf9b7))
|
|
405
|
-
* reduce number of `require` for `urls()` ([#854](https://github.com/webpack-contrib/css-loader/issues/854)) ([3338656](https://github.com/webpack-contrib/css-loader/commit/3338656))
|
|
406
|
-
* support deduplication of string module ids (optimization.namedModules) ([#789](https://github.com/webpack-contrib/css-loader/issues/789)) ([e3bb83a](https://github.com/webpack-contrib/css-loader/commit/e3bb83a))
|
|
407
|
-
* support module resolution in `composes` ([#845](https://github.com/webpack-contrib/css-loader/issues/845)) ([453248f](https://github.com/webpack-contrib/css-loader/commit/453248f))
|
|
408
|
-
* same `urls()` resolving logic for `modules` (`local` and `global`) and without modules ([#843](https://github.com/webpack-contrib/css-loader/issues/843)) ([fdcf687](https://github.com/webpack-contrib/css-loader/commit/fdcf687))
|
|
409
|
-
|
|
410
|
-
### Features
|
|
411
|
-
|
|
412
|
-
* allow to disable css modules and **disable their by default** ([#842](https://github.com/webpack-contrib/css-loader/issues/842)) ([889dc7f](https://github.com/webpack-contrib/css-loader/commit/889dc7f))
|
|
413
|
-
* disable `import` option doesn't affect on `composes` ([#822](https://github.com/webpack-contrib/css-loader/issues/822)) ([f9aa73c](https://github.com/webpack-contrib/css-loader/commit/f9aa73c))
|
|
414
|
-
* allow to filter `urls` ([#856](https://github.com/webpack-contrib/css-loader/issues/856)) ([5e702e7](https://github.com/webpack-contrib/css-loader/commit/5e702e7))
|
|
415
|
-
* allow to filter `import` at-rules ([#857](https://github.com/webpack-contrib/css-loader/issues/857)) ([5e6034c](https://github.com/webpack-contrib/css-loader/commit/5e6034c))
|
|
416
|
-
* emit warning on invalid `urls()` ([#832](https://github.com/webpack-contrib/css-loader/issues/832)) ([da95db8](https://github.com/webpack-contrib/css-loader/commit/da95db8))
|
|
417
|
-
* added `exportOnlyLocals` option ([#824](https://github.com/webpack-contrib/css-loader/issues/824)) ([e9327c0](https://github.com/webpack-contrib/css-loader/commit/e9327c0))
|
|
418
|
-
* reuse `postcss` ast from other loaders (i.e `postcss-loader`) ([#840](https://github.com/webpack-contrib/css-loader/issues/840)) ([1dad1fb](https://github.com/webpack-contrib/css-loader/commit/1dad1fb))
|
|
419
|
-
* schema options ([b97d997](https://github.com/webpack-contrib/css-loader/commit/b97d997))
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
### BREAKING CHANGES
|
|
423
|
-
|
|
424
|
-
* resolving logic for `url()` and `import` at-rules works the same everywhere, it does not matter whether css modules are enabled (with `global` and `local` module) or not. Examples - `url('image.png')` as `require('./image.png')`, `url('./image.png')` as `require('./image.png')`, `url('~module/image.png')` as `require('module/image.png')`.
|
|
425
|
-
* by default css modules are disabled (now `modules: false` disable all css modules features), you can return old behaviour change this on `modules: 'global'`
|
|
426
|
-
* `css-loader/locals` was dropped in favor `exportOnlyLocals` option
|
|
427
|
-
* `import` option only affect on `import` at-rules and doesn't affect on `composes` declarations
|
|
428
|
-
* invalid `@import` at rules now emit warnings
|
|
429
|
-
* use `postcss@7`
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
<a name="1.0.1"></a>
|
|
434
|
-
## [1.0.1](https://github.com/webpack-contrib/css-loader/compare/v1.0.0...v1.0.1) (2018-10-29)
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
### Bug Fixes
|
|
438
|
-
|
|
439
|
-
* **loader:** trim unquoted import urls ([#783](https://github.com/webpack-contrib/css-loader/issues/783)) ([21fcddf](https://github.com/webpack-contrib/css-loader/commit/21fcddf))
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
<a name="1.0.0"></a>
|
|
444
|
-
# [1.0.0](https://github.com/webpack-contrib/css-loader/compare/v0.28.11...v1.0.0) (2018-07-06)
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
### BREAKING CHANGES
|
|
448
|
-
|
|
449
|
-
* remove `minimize` option, use [`postcss-loader`](https://github.com/postcss/postcss-loader) with [`cssnano`](https://github.com/cssnano/cssnano) or use [`optimize-cssnano-plugin`](https://github.com/intervolga/optimize-cssnano-plugin) plugin
|
|
450
|
-
* remove `module` option, use `modules` option instead
|
|
451
|
-
* remove `camelcase` option, use `camelCase` option instead
|
|
452
|
-
* remove `root` option, use [`postcss-loader`](https://github.com/postcss/postcss-loader) with [`postcss-url`](https://github.com/postcss/postcss-url) plugin
|
|
453
|
-
* remove `alias` option, use [`resolve.alias`](https://webpack.js.org/configuration/resolve/) feature or use [`postcss-loader`](https://github.com/postcss/postcss-loader) with [`postcss-url`](https://github.com/postcss/postcss-url) plugin
|
|
454
|
-
* update `postcss` to `6` version
|
|
455
|
-
* minimum require `nodejs` version is `6.9`
|
|
456
|
-
* minimum require `webpack` version is `4`
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
<a name="0.28.11"></a>
|
|
461
|
-
## [0.28.11](https://github.com/webpack-contrib/css-loader/compare/v0.28.10...v0.28.11) (2018-03-16)
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
### Bug Fixes
|
|
465
|
-
|
|
466
|
-
* **lib/processCss:** don't check `mode` for `url` handling (`options.modules`) ([#698](https://github.com/webpack-contrib/css-loader/issues/698)) ([c788450](https://github.com/webpack-contrib/css-loader/commit/c788450))
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
<a name="0.28.10"></a>
|
|
471
|
-
## [0.28.10](https://github.com/webpack-contrib/css-loader/compare/v0.28.9...v0.28.10) (2018-02-22)
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
### Bug Fixes
|
|
475
|
-
|
|
476
|
-
* **getLocalIdent:** add `rootContext` support (`webpack >= v4.0.0`) ([#681](https://github.com/webpack-contrib/css-loader/issues/681)) ([9f876d2](https://github.com/webpack-contrib/css-loader/commit/9f876d2))
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
<a name="0.28.9"></a>
|
|
481
|
-
## [0.28.9](https://github.com/webpack-contrib/css-loader/compare/v0.28.8...v0.28.9) (2018-01-17)
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
### Bug Fixes
|
|
485
|
-
|
|
486
|
-
* ignore invalid URLs (`url()`) ([#663](https://github.com/webpack-contrib/css-loader/issues/663)) ([d1d8221](https://github.com/webpack-contrib/css-loader/commit/d1d8221))
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
<a name="0.28.8"></a>
|
|
491
|
-
## [0.28.8](https://github.com/webpack-contrib/css-loader/compare/v0.28.7...v0.28.8) (2018-01-05)
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
### Bug Fixes
|
|
495
|
-
|
|
496
|
-
* **loader:** correctly check if source map is `undefined` ([#641](https://github.com/webpack-contrib/css-loader/issues/641)) ([0dccfa9](https://github.com/webpack-contrib/css-loader/commit/0dccfa9))
|
|
497
|
-
* proper URL escaping and wrapping (`url()`) ([#627](https://github.com/webpack-contrib/css-loader/issues/627)) ([8897d44](https://github.com/webpack-contrib/css-loader/commit/8897d44))
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
<a name="0.28.7"></a>
|
|
502
|
-
## [0.28.7](https://github.com/webpack/css-loader/compare/v0.28.6...v0.28.7) (2017-08-30)
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
### Bug Fixes
|
|
506
|
-
|
|
507
|
-
* pass resolver to `localsLoader` (`options.alias`) ([#601](https://github.com/webpack/css-loader/issues/601)) ([8f1b57c](https://github.com/webpack/css-loader/commit/8f1b57c))
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
<a name="0.28.6"></a>
|
|
512
|
-
## [0.28.6](https://github.com/webpack/css-loader/compare/v0.28.5...v0.28.6) (2017-08-30)
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
### Bug Fixes
|
|
516
|
-
|
|
517
|
-
* add support for aliases starting with `/` (`options.alias`) ([#597](https://github.com/webpack/css-loader/issues/597)) ([63567f2](https://github.com/webpack/css-loader/commit/63567f2))
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
<a name="0.28.5"></a>
|
|
522
|
-
## [0.28.5](https://github.com/webpack/css-loader/compare/v0.28.4...v0.28.5) (2017-08-17)
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
### Bug Fixes
|
|
526
|
-
|
|
527
|
-
* match mutliple dashes (`options.camelCase`) ([#556](https://github.com/webpack/css-loader/issues/556)) ([1fee601](https://github.com/webpack/css-loader/commit/1fee601))
|
|
528
|
-
* stricter `[@import](https://github.com/import)` tolerance ([#593](https://github.com/webpack/css-loader/issues/593)) ([2e4ec09](https://github.com/webpack/css-loader/commit/2e4ec09))
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
<a name="0.28.4"></a>
|
|
533
|
-
## [0.28.4](https://github.com/webpack/css-loader/compare/v0.28.3...v0.28.4) (2017-05-30)
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
### Bug Fixes
|
|
537
|
-
|
|
538
|
-
* preserve leading underscore in class names ([#543](https://github.com/webpack/css-loader/issues/543)) ([f6673c8](https://github.com/webpack/css-loader/commit/f6673c8))
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
<a name="0.28.3"></a>
|
|
543
|
-
## [0.28.3](https://github.com/webpack/css-loader/compare/v0.28.2...v0.28.3) (2017-05-25)
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
### Bug Fixes
|
|
547
|
-
|
|
548
|
-
* correct plugin order for CSS Modules ([#534](https://github.com/webpack/css-loader/issues/534)) ([b90f492](https://github.com/webpack/css-loader/commit/b90f492))
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
<a name="0.28.2"></a>
|
|
553
|
-
## [0.28.2](https://github.com/webpack/css-loader/compare/v0.28.1...v0.28.2) (2017-05-22)
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
### Bug Fixes
|
|
557
|
-
|
|
558
|
-
* source maps path on `windows` ([#532](https://github.com/webpack/css-loader/issues/532)) ([c3d0d91](https://github.com/webpack/css-loader/commit/c3d0d91))
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
<a name="0.28.1"></a>
|
|
563
|
-
## [0.28.1](https://github.com/webpack/css-loader/compare/v0.28.0...v0.28.1) (2017-05-02)
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
### Bug Fixes
|
|
567
|
-
|
|
568
|
-
* allow to specify a full hostname as a root URL ([#521](https://github.com/webpack/css-loader/issues/521)) ([06d27a1](https://github.com/webpack/css-loader/commit/06d27a1))
|
|
569
|
-
* case insensitivity of [@import](https://github.com/import) ([#514](https://github.com/webpack/css-loader/issues/514)) ([de4356b](https://github.com/webpack/css-loader/commit/de4356b))
|
|
570
|
-
* don't handle empty [@import](https://github.com/import) and url() ([#513](https://github.com/webpack/css-loader/issues/513)) ([868fc94](https://github.com/webpack/css-loader/commit/868fc94))
|
|
571
|
-
* imported variables are replaced in exports if followed by a comma ([#504](https://github.com/webpack/css-loader/issues/504)) ([956bad7](https://github.com/webpack/css-loader/commit/956bad7))
|
|
572
|
-
* loader now correctly handles `url` with space(s) ([#495](https://github.com/webpack/css-loader/issues/495)) ([534ea55](https://github.com/webpack/css-loader/commit/534ea55))
|
|
573
|
-
* url with a trailing space is now handled correctly ([#494](https://github.com/webpack/css-loader/issues/494)) ([e1ec4f2](https://github.com/webpack/css-loader/commit/e1ec4f2))
|
|
574
|
-
* use `btoa` instead `Buffer` ([#501](https://github.com/webpack/css-loader/issues/501)) ([fbb0714](https://github.com/webpack/css-loader/commit/fbb0714))
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
### Performance Improvements
|
|
578
|
-
|
|
579
|
-
* generate source maps only when explicitly set ([#478](https://github.com/webpack/css-loader/issues/478)) ([b8f5c8f](https://github.com/webpack/css-loader/commit/b8f5c8f))
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
<a name="0.28.0"></a>
|
|
584
|
-
# [0.28.0](https://github.com/webpack/css-loader/compare/v0.27.3...v0.28.0) (2017-03-30)
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
### Features
|
|
588
|
-
|
|
589
|
-
* add alias feature to rewrite URLs ([#274](https://github.com/webpack/css-loader/issues/274)) ([c8db489](https://github.com/webpack/css-loader/commit/c8db489))
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
<a name="0.27.3"></a>
|
|
594
|
-
## [0.27.3](https://github.com/webpack/css-loader/compare/v0.27.2...v0.27.3) (2017-03-13)
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
<a name="0.27.2"></a>
|
|
599
|
-
# [0.27.2](https://github.com/webpack/css-loader/compare/v0.27.1...v0.27.2) (2017-03-12)
|
|
600
|
-
|
|
601
|
-
<a name="0.27.1"></a>
|
|
602
|
-
# [0.27.1](https://github.com/webpack/css-loader/compare/v0.27.0...v0.27.1) (2017-03-10)
|
|
603
|
-
|
|
604
|
-
<a name="0.27.0"></a>
|
|
605
|
-
# [0.27.0](https://github.com/webpack/css-loader/compare/v0.26.2...v0.27.0) (2017-03-10)
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
### Bug Fixes
|
|
609
|
-
|
|
610
|
-
* **sourcemaps:** use abs paths & remove sourceRoot ([c769ac3](https://github.com/webpack/css-loader/commit/c769ac3))
|
|
611
|
-
* `minimizeOptions` should be `query.minimize`! ([16c0858](https://github.com/webpack/css-loader/commit/16c0858))
|
|
612
|
-
* do not export duplicate keys ([#420](https://github.com/webpack/css-loader/issues/420)) ([a2b85d7](https://github.com/webpack/css-loader/commit/a2b85d7))
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
### Features
|
|
616
|
-
|
|
617
|
-
* allow removal of original class name ([#445](https://github.com/webpack/css-loader/issues/445)) ([3f78361](https://github.com/webpack/css-loader/commit/3f78361))
|
|
618
|
-
* Include the sourceMappingURL & sourceURL when toString() ([6da7e90](https://github.com/webpack/css-loader/commit/6da7e90))
|