css-loader 3.3.1 → 3.4.2
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/CHANGELOG.md +34 -0
- package/README.md +29 -0
- package/dist/index.js +3 -2
- package/dist/options.json +4 -0
- package/dist/runtime/api.js +22 -18
- package/dist/utils.js +79 -67
- package/package.json +34 -32
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,40 @@
|
|
|
2
2
|
|
|
3
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
4
|
|
|
5
|
+
### [3.4.2](https://github.com/webpack-contrib/css-loader/compare/v3.4.1...v3.4.2) (2020-01-10)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* 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))
|
|
11
|
+
|
|
12
|
+
### [3.4.1](https://github.com/webpack-contrib/css-loader/compare/v3.4.0...v3.4.1) (2020-01-03)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* 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))
|
|
18
|
+
* 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))
|
|
19
|
+
|
|
20
|
+
## [3.4.0](https://github.com/webpack-contrib/css-loader/compare/v3.3.1...v3.4.0) (2019-12-17)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Features
|
|
24
|
+
|
|
25
|
+
* `esModule` option ([#1026](https://github.com/webpack-contrib/css-loader/issues/1026)) ([d358cdb](https://github.com/webpack-contrib/css-loader/commit/d358cdbe2c026afafa0279003cb6c8a3eff4c419))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Bug Fixes
|
|
29
|
+
|
|
30
|
+
* 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))
|
|
31
|
+
|
|
32
|
+
### [3.3.2](https://github.com/webpack-contrib/css-loader/compare/v3.3.1...v3.3.2) (2019-12-12)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### Bug Fixes
|
|
36
|
+
|
|
37
|
+
* logic for order and media queries for imports ([1fb5134](https://github.com/webpack-contrib/css-loader/commit/1fb51340a7719b6f5b517cb71ea85ec5d45c1199))
|
|
38
|
+
|
|
5
39
|
### [3.3.1](https://github.com/webpack-contrib/css-loader/compare/v3.3.0...v3.3.1) (2019-12-12)
|
|
6
40
|
|
|
7
41
|
|
package/README.md
CHANGED
|
@@ -118,6 +118,7 @@ module.exports = {
|
|
|
118
118
|
| **[`importLoaders`](#importloaders)** | `{Number}` | `0` | Enables/Disables or setups number of loaders applied before CSS loader |
|
|
119
119
|
| **[`localsConvention`](#localsconvention)** | `{String}` | `'asIs'` | Style of exported classnames |
|
|
120
120
|
| **[`onlyLocals`](#onlylocals)** | `{Boolean}` | `false` | Export only locals |
|
|
121
|
+
| **[`esModule`](#esmodule)** | `{Boolean}` | `false` | Use ES modules syntax |
|
|
121
122
|
|
|
122
123
|
### `url`
|
|
123
124
|
|
|
@@ -857,6 +858,34 @@ module.exports = {
|
|
|
857
858
|
};
|
|
858
859
|
```
|
|
859
860
|
|
|
861
|
+
### `esModule`
|
|
862
|
+
|
|
863
|
+
Type: `Boolean`
|
|
864
|
+
Default: `false`
|
|
865
|
+
|
|
866
|
+
By default, `css-loader` generates JS modules that use the CommonJS modules syntax.
|
|
867
|
+
There are some cases in which using ES modules is beneficial, like in the case of [module concatenation](https://webpack.js.org/plugins/module-concatenation-plugin/) and [tree shaking](https://webpack.js.org/guides/tree-shaking/).
|
|
868
|
+
|
|
869
|
+
You can enable a ES module syntax using:
|
|
870
|
+
|
|
871
|
+
**webpack.config.js**
|
|
872
|
+
|
|
873
|
+
```js
|
|
874
|
+
module.exports = {
|
|
875
|
+
module: {
|
|
876
|
+
rules: [
|
|
877
|
+
{
|
|
878
|
+
test: /\.css$/i,
|
|
879
|
+
loader: 'css-loader',
|
|
880
|
+
options: {
|
|
881
|
+
esModule: true,
|
|
882
|
+
},
|
|
883
|
+
},
|
|
884
|
+
],
|
|
885
|
+
},
|
|
886
|
+
};
|
|
887
|
+
```
|
|
888
|
+
|
|
860
889
|
## Examples
|
|
861
890
|
|
|
862
891
|
### Assets
|
package/dist/index.js
CHANGED
|
@@ -106,9 +106,10 @@ function loader(content, map, meta) {
|
|
|
106
106
|
importLoaders,
|
|
107
107
|
localsConvention
|
|
108
108
|
} = options;
|
|
109
|
-
const
|
|
109
|
+
const esModule = typeof options.esModule !== 'undefined' ? options.esModule : false;
|
|
110
|
+
const importCode = (0, _utils.getImportCode)(this, imports, exportType, sourceMap, importLoaders, esModule);
|
|
110
111
|
const moduleCode = (0, _utils.getModuleCode)(this, result, exportType, sourceMap, replacers);
|
|
111
|
-
const exportCode = (0, _utils.getExportCode)(this, exports, exportType, replacers, localsConvention);
|
|
112
|
+
const exportCode = (0, _utils.getExportCode)(this, exports, exportType, replacers, localsConvention, esModule);
|
|
112
113
|
return callback(null, [importCode, moduleCode, exportCode].join(''));
|
|
113
114
|
}).catch(error => {
|
|
114
115
|
callback(error.name === 'CssSyntaxError' ? new _CssSyntaxError.default(error) : error);
|
package/dist/options.json
CHANGED
|
@@ -94,6 +94,10 @@
|
|
|
94
94
|
"onlyLocals": {
|
|
95
95
|
"description": "Export only locals (https://github.com/webpack-contrib/css-loader#onlylocals).",
|
|
96
96
|
"type": "boolean"
|
|
97
|
+
},
|
|
98
|
+
"esModule": {
|
|
99
|
+
"description": "Use the ES modules syntax (https://github.com/webpack-contrib/css-loader#esmodule).",
|
|
100
|
+
"type": "boolean"
|
|
97
101
|
}
|
|
98
102
|
},
|
|
99
103
|
"type": "object"
|
package/dist/runtime/api.js
CHANGED
|
@@ -14,7 +14,7 @@ module.exports = function (useSourceMap) {
|
|
|
14
14
|
var content = cssWithMappingToString(item, useSourceMap);
|
|
15
15
|
|
|
16
16
|
if (item[2]) {
|
|
17
|
-
return "@media ".concat(item[2], "{").concat(content, "}");
|
|
17
|
+
return "@media ".concat(item[2], " {").concat(content, "}");
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
return content;
|
|
@@ -23,7 +23,7 @@ module.exports = function (useSourceMap) {
|
|
|
23
23
|
// eslint-disable-next-line func-names
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
list.i = function (modules, mediaQuery) {
|
|
26
|
+
list.i = function (modules, mediaQuery, dedupe) {
|
|
27
27
|
if (typeof modules === 'string') {
|
|
28
28
|
// eslint-disable-next-line no-param-reassign
|
|
29
29
|
modules = [[null, modules, '']];
|
|
@@ -31,30 +31,34 @@ module.exports = function (useSourceMap) {
|
|
|
31
31
|
|
|
32
32
|
var alreadyImportedModules = {};
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
if (dedupe) {
|
|
35
|
+
for (var i = 0; i < this.length; i++) {
|
|
36
|
+
// eslint-disable-next-line prefer-destructuring
|
|
37
|
+
var id = this[i][0];
|
|
37
38
|
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
if (id != null) {
|
|
40
|
+
alreadyImportedModules[id] = true;
|
|
41
|
+
}
|
|
40
42
|
}
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
for (var _i = 0; _i < modules.length; _i++) {
|
|
44
|
-
var item = modules[_i];
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
var item = [].concat(modules[_i]);
|
|
47
|
+
|
|
48
|
+
if (dedupe && alreadyImportedModules[item[0]]) {
|
|
49
|
+
// eslint-disable-next-line no-continue
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
48
52
|
|
|
49
|
-
if (
|
|
50
|
-
if (
|
|
53
|
+
if (mediaQuery) {
|
|
54
|
+
if (!item[2]) {
|
|
51
55
|
item[2] = mediaQuery;
|
|
52
|
-
} else
|
|
53
|
-
item[2] = "
|
|
56
|
+
} else {
|
|
57
|
+
item[2] = "".concat(mediaQuery, " and ").concat(item[2]);
|
|
54
58
|
}
|
|
55
|
-
|
|
56
|
-
list.push(item);
|
|
57
59
|
}
|
|
60
|
+
|
|
61
|
+
list.push(item);
|
|
58
62
|
}
|
|
59
63
|
};
|
|
60
64
|
|
|
@@ -73,7 +77,7 @@ function cssWithMappingToString(item, useSourceMap) {
|
|
|
73
77
|
if (useSourceMap && typeof btoa === 'function') {
|
|
74
78
|
var sourceMapping = toComment(cssMapping);
|
|
75
79
|
var sourceURLs = cssMapping.sources.map(function (source) {
|
|
76
|
-
return "/*# sourceURL=".concat(cssMapping.sourceRoot).concat(source, " */");
|
|
80
|
+
return "/*# sourceURL=".concat(cssMapping.sourceRoot || '').concat(source, " */");
|
|
77
81
|
});
|
|
78
82
|
return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
|
|
79
83
|
}
|
package/dist/utils.js
CHANGED
|
@@ -148,7 +148,7 @@ function normalizeSourceMap(map) {
|
|
|
148
148
|
// Strip any JSON XSSI avoidance prefix from the string (as documented in the source maps specification), and then parse the string as JSON.
|
|
149
149
|
|
|
150
150
|
if (typeof newMap === 'string') {
|
|
151
|
-
newMap = JSON.parse(newMap
|
|
151
|
+
newMap = JSON.parse(newMap);
|
|
152
152
|
} // Source maps should use forward slash because it is URLs (https://github.com/mozilla/source-map/issues/91)
|
|
153
153
|
// We should normalize path because previous loaders like `sass-loader` using backslash when generate source map
|
|
154
154
|
|
|
@@ -178,7 +178,7 @@ function getImportPrefix(loaderContext, importLoaders) {
|
|
|
178
178
|
return `-!${loadersRequest}!`;
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
function getImportCode(loaderContext, imports, exportType, sourceMap, importLoaders) {
|
|
181
|
+
function getImportCode(loaderContext, imports, exportType, sourceMap, importLoaders, esModule) {
|
|
182
182
|
const importItems = [];
|
|
183
183
|
const codeItems = [];
|
|
184
184
|
const atRuleImportNames = new Map();
|
|
@@ -186,8 +186,8 @@ function getImportCode(loaderContext, imports, exportType, sourceMap, importLoad
|
|
|
186
186
|
let importPrefix;
|
|
187
187
|
|
|
188
188
|
if (exportType === 'full') {
|
|
189
|
-
importItems.push(`var ___CSS_LOADER_API_IMPORT___ = require(${(0, _loaderUtils.stringifyRequest)(loaderContext, require.resolve('./runtime/api'))});`);
|
|
190
|
-
codeItems.push(`exports =
|
|
189
|
+
importItems.push(esModule ? `import ___CSS_LOADER_API_IMPORT___ from ${(0, _loaderUtils.stringifyRequest)(loaderContext, require.resolve('./runtime/api'))};` : `var ___CSS_LOADER_API_IMPORT___ = require(${(0, _loaderUtils.stringifyRequest)(loaderContext, require.resolve('./runtime/api'))});`);
|
|
190
|
+
codeItems.push(esModule ? `var exports = ___CSS_LOADER_API_IMPORT___(${sourceMap});` : `exports = ___CSS_LOADER_API_IMPORT___(${sourceMap});`);
|
|
191
191
|
}
|
|
192
192
|
|
|
193
193
|
imports.forEach(item => {
|
|
@@ -214,7 +214,7 @@ function getImportCode(loaderContext, imports, exportType, sourceMap, importLoad
|
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
importName = `___CSS_LOADER_AT_RULE_IMPORT_${atRuleImportNames.size}___`;
|
|
217
|
-
importItems.push(`var ${importName} = require(${(0, _loaderUtils.stringifyRequest)(loaderContext, importPrefix + url)});`);
|
|
217
|
+
importItems.push(esModule ? `import ${importName} from ${(0, _loaderUtils.stringifyRequest)(loaderContext, importPrefix + url)};` : `var ${importName} = require(${(0, _loaderUtils.stringifyRequest)(loaderContext, importPrefix + url)});`);
|
|
218
218
|
atRuleImportNames.set(url, importName);
|
|
219
219
|
}
|
|
220
220
|
|
|
@@ -225,7 +225,7 @@ function getImportCode(loaderContext, imports, exportType, sourceMap, importLoad
|
|
|
225
225
|
case 'url':
|
|
226
226
|
{
|
|
227
227
|
if (urlImportNames.size === 0) {
|
|
228
|
-
importItems.push(`var ___CSS_LOADER_GET_URL_IMPORT___ = require(${(0, _loaderUtils.stringifyRequest)(loaderContext, require.resolve('./runtime/getUrl.js'))});`);
|
|
228
|
+
importItems.push(esModule ? `import ___CSS_LOADER_GET_URL_IMPORT___ from ${(0, _loaderUtils.stringifyRequest)(loaderContext, require.resolve('./runtime/getUrl.js'))};` : `var ___CSS_LOADER_GET_URL_IMPORT___ = require(${(0, _loaderUtils.stringifyRequest)(loaderContext, require.resolve('./runtime/getUrl.js'))});`);
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
const {
|
|
@@ -238,7 +238,7 @@ function getImportCode(loaderContext, imports, exportType, sourceMap, importLoad
|
|
|
238
238
|
|
|
239
239
|
if (!importName) {
|
|
240
240
|
importName = `___CSS_LOADER_URL_IMPORT_${urlImportNames.size}___`;
|
|
241
|
-
importItems.push(`var ${importName} = require(${(0, _loaderUtils.stringifyRequest)(loaderContext, url)});`);
|
|
241
|
+
importItems.push(esModule ? `import ${importName} from ${(0, _loaderUtils.stringifyRequest)(loaderContext, url)};` : `var ${importName} = require(${(0, _loaderUtils.stringifyRequest)(loaderContext, url)});`);
|
|
242
242
|
urlImportNames.set(url, importName);
|
|
243
243
|
}
|
|
244
244
|
|
|
@@ -255,16 +255,16 @@ function getImportCode(loaderContext, imports, exportType, sourceMap, importLoad
|
|
|
255
255
|
url,
|
|
256
256
|
media
|
|
257
257
|
} = item;
|
|
258
|
-
const preparedMedia = media ? `, ${JSON.stringify(media)}` : '';
|
|
258
|
+
const preparedMedia = media ? `, ${JSON.stringify(media)}` : ', ""';
|
|
259
259
|
|
|
260
260
|
if (!importPrefix) {
|
|
261
261
|
importPrefix = getImportPrefix(loaderContext, importLoaders);
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
-
importItems.push(`var ${importName} = require(${(0, _loaderUtils.stringifyRequest)(loaderContext, importPrefix + url)});`);
|
|
264
|
+
importItems.push(esModule ? `import ${importName} from ${(0, _loaderUtils.stringifyRequest)(loaderContext, importPrefix + url)};` : `var ${importName} = require(${(0, _loaderUtils.stringifyRequest)(loaderContext, importPrefix + url)});`);
|
|
265
265
|
|
|
266
266
|
if (exportType === 'full') {
|
|
267
|
-
codeItems.push(`exports.i(${importName}${preparedMedia});`);
|
|
267
|
+
codeItems.push(`exports.i(${importName}${preparedMedia}, true);`);
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
270
|
break;
|
|
@@ -310,76 +310,88 @@ function dashesCamelCase(str) {
|
|
|
310
310
|
return str.replace(/-+(\w)/g, (match, firstLetter) => firstLetter.toUpperCase());
|
|
311
311
|
}
|
|
312
312
|
|
|
313
|
-
function getExportCode(loaderContext, exports, exportType, replacers, localsConvention) {
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
}
|
|
313
|
+
function getExportCode(loaderContext, exports, exportType, replacers, localsConvention, esModule) {
|
|
314
|
+
const exportItems = [];
|
|
315
|
+
let exportLocalsCode;
|
|
317
316
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
const addExportedItem = (name, value) => {
|
|
321
|
-
items.push(`\t${JSON.stringify(name)}: ${JSON.stringify(value)}`);
|
|
322
|
-
};
|
|
317
|
+
if (exports.length > 0) {
|
|
318
|
+
const exportLocals = [];
|
|
323
319
|
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
value
|
|
328
|
-
} = item;
|
|
320
|
+
const addExportedLocal = (name, value) => {
|
|
321
|
+
exportLocals.push(`\t${JSON.stringify(name)}: ${JSON.stringify(value)}`);
|
|
322
|
+
};
|
|
329
323
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
324
|
+
exports.forEach(item => {
|
|
325
|
+
const {
|
|
326
|
+
name,
|
|
327
|
+
value
|
|
328
|
+
} = item;
|
|
329
|
+
|
|
330
|
+
switch (localsConvention) {
|
|
331
|
+
case 'camelCase':
|
|
332
|
+
{
|
|
333
|
+
addExportedLocal(name, value);
|
|
334
|
+
const modifiedName = (0, _camelcase.default)(name);
|
|
335
|
+
|
|
336
|
+
if (modifiedName !== name) {
|
|
337
|
+
addExportedLocal(modifiedName, value);
|
|
338
|
+
}
|
|
335
339
|
|
|
336
|
-
|
|
337
|
-
addExportedItem(modifiedName, value);
|
|
340
|
+
break;
|
|
338
341
|
}
|
|
339
342
|
|
|
340
|
-
|
|
341
|
-
|
|
343
|
+
case 'camelCaseOnly':
|
|
344
|
+
{
|
|
345
|
+
addExportedLocal((0, _camelcase.default)(name), value);
|
|
346
|
+
break;
|
|
347
|
+
}
|
|
342
348
|
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
}
|
|
349
|
+
case 'dashes':
|
|
350
|
+
{
|
|
351
|
+
addExportedLocal(name, value);
|
|
352
|
+
const modifiedName = dashesCamelCase(name);
|
|
348
353
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
const modifiedName = dashesCamelCase(name);
|
|
354
|
+
if (modifiedName !== name) {
|
|
355
|
+
addExportedLocal(modifiedName, value);
|
|
356
|
+
}
|
|
353
357
|
|
|
354
|
-
|
|
355
|
-
addExportedItem(modifiedName, value);
|
|
358
|
+
break;
|
|
356
359
|
}
|
|
357
360
|
|
|
358
|
-
|
|
359
|
-
|
|
361
|
+
case 'dashesOnly':
|
|
362
|
+
{
|
|
363
|
+
addExportedLocal(dashesCamelCase(name), value);
|
|
364
|
+
break;
|
|
365
|
+
}
|
|
360
366
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
367
|
+
case 'asIs':
|
|
368
|
+
default:
|
|
369
|
+
addExportedLocal(name, value);
|
|
364
370
|
break;
|
|
365
|
-
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
exportLocalsCode = exportLocals.join(',\n');
|
|
374
|
+
replacers.forEach(replacer => {
|
|
375
|
+
if (replacer.type === 'icss-import') {
|
|
376
|
+
const {
|
|
377
|
+
replacementName,
|
|
378
|
+
importName,
|
|
379
|
+
localName
|
|
380
|
+
} = replacer;
|
|
381
|
+
exportLocalsCode = exportLocalsCode.replace(new RegExp(replacementName, 'g'), () => exportType === 'locals' ? `" + ${importName}[${JSON.stringify(localName)}] + "` : `" + ${importName}.locals[${JSON.stringify(localName)}] + "`);
|
|
382
|
+
}
|
|
383
|
+
});
|
|
384
|
+
}
|
|
366
385
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
});
|
|
373
|
-
let exportCode = `// Exports\n${exportType === 'locals' ? 'module.exports' : 'exports.locals'} = {\n${items.join(',\n')}\n};`;
|
|
374
|
-
replacers.forEach(replacer => {
|
|
375
|
-
if (replacer.type === 'icss-import') {
|
|
376
|
-
const {
|
|
377
|
-
replacementName,
|
|
378
|
-
importName,
|
|
379
|
-
localName
|
|
380
|
-
} = replacer;
|
|
381
|
-
exportCode = exportCode.replace(new RegExp(replacementName, 'g'), () => exportType === 'locals' ? `" + ${importName}[${JSON.stringify(localName)}] + "` : `" + ${importName}.locals[${JSON.stringify(localName)}] + "`);
|
|
386
|
+
if (exportType === 'locals') {
|
|
387
|
+
exportItems.push(`${esModule ? 'export default' : 'module.exports ='} ${exportLocalsCode ? `{\n${exportLocalsCode}\n}` : '{}'};`);
|
|
388
|
+
} else {
|
|
389
|
+
if (exportLocalsCode) {
|
|
390
|
+
exportItems.push(`exports.locals = {\n${exportLocalsCode}\n};`);
|
|
382
391
|
}
|
|
383
|
-
|
|
384
|
-
|
|
392
|
+
|
|
393
|
+
exportItems.push(`${esModule ? 'export default' : 'module.exports ='} exports;`);
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
return `// Exports\n${exportItems.join('\n')}\n`;
|
|
385
397
|
}
|
package/package.json
CHANGED
|
@@ -1,44 +1,46 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "css-loader",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.2",
|
|
4
4
|
"description": "css loader module for webpack",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "webpack-contrib/css-loader",
|
|
7
7
|
"author": "Tobias Koppers @sokra",
|
|
8
8
|
"homepage": "https://github.com/webpack-contrib/css-loader",
|
|
9
9
|
"bugs": "https://github.com/webpack-contrib/css-loader/issues",
|
|
10
|
+
"funding": {
|
|
11
|
+
"type": "opencollective",
|
|
12
|
+
"url": "https://opencollective.com/webpack"
|
|
13
|
+
},
|
|
10
14
|
"main": "dist/cjs.js",
|
|
11
15
|
"engines": {
|
|
12
16
|
"node": ">= 8.9.0"
|
|
13
17
|
},
|
|
14
18
|
"scripts": {
|
|
15
19
|
"start": "npm run build -- -w",
|
|
16
|
-
"
|
|
17
|
-
"build": "cross-env NODE_ENV=production babel src -d dist --ignore \"src/**/*.test.js\" --copy-files",
|
|
20
|
+
"clean": "del-cli dist",
|
|
18
21
|
"validate:runtime": "es-check es5 \"dist/runtime/**/*.js\"",
|
|
22
|
+
"prebuild": "npm run clean",
|
|
23
|
+
"build": "cross-env NODE_ENV=production babel src -d dist --copy-files",
|
|
19
24
|
"postbuild": "npm run validate:runtime",
|
|
20
|
-
"clean": "del-cli dist",
|
|
21
25
|
"commitlint": "commitlint --from=master",
|
|
22
|
-
"lint:prettier": "prettier \"{**/*,*}.{js,json,md,yml,css}\" --list-different",
|
|
23
|
-
"lint:js": "eslint --cache src test",
|
|
24
|
-
"lint": "npm-run-all -l -p \"lint:**\"",
|
|
25
|
-
"prepare": "npm run build",
|
|
26
|
-
"release": "standard-version",
|
|
27
26
|
"security": "npm audit",
|
|
27
|
+
"lint:prettier": "prettier \"{**/*,*}.{js,json,md,yml,css,ts}\" --list-different",
|
|
28
|
+
"lint:js": "eslint --cache .",
|
|
29
|
+
"lint": "npm-run-all -l -p \"lint:**\"",
|
|
28
30
|
"test:only": "cross-env NODE_ENV=test jest",
|
|
29
|
-
"test:watch": "
|
|
30
|
-
"test:coverage": "
|
|
31
|
+
"test:watch": "npm run test:only -- --watch",
|
|
32
|
+
"test:coverage": "npm run test:only -- --collectCoverageFrom=\"src/**/*.js\" --coverage",
|
|
31
33
|
"pretest": "npm run lint",
|
|
32
|
-
"test": "
|
|
34
|
+
"test": "npm run test:coverage",
|
|
35
|
+
"prepare": "npm run build",
|
|
36
|
+
"release": "standard-version",
|
|
33
37
|
"defaults": "webpack-defaults"
|
|
34
38
|
},
|
|
35
39
|
"files": [
|
|
36
|
-
"dist
|
|
37
|
-
"lib/",
|
|
38
|
-
"index.js"
|
|
40
|
+
"dist"
|
|
39
41
|
],
|
|
40
42
|
"peerDependencies": {
|
|
41
|
-
"webpack": "^4.0.0"
|
|
43
|
+
"webpack": "^4.0.0 || ^5.0.0"
|
|
42
44
|
},
|
|
43
45
|
"dependencies": {
|
|
44
46
|
"camelcase": "^5.3.1",
|
|
@@ -55,38 +57,38 @@
|
|
|
55
57
|
"schema-utils": "^2.6.0"
|
|
56
58
|
},
|
|
57
59
|
"devDependencies": {
|
|
58
|
-
"@babel/cli": "^7.7.
|
|
59
|
-
"@babel/core": "^7.7.
|
|
60
|
-
"@babel/preset-env": "^7.7.
|
|
61
|
-
"@commitlint/cli": "^8.
|
|
62
|
-
"@commitlint/config-conventional": "^8.
|
|
63
|
-
"@webpack-contrib/defaults": "^
|
|
60
|
+
"@babel/cli": "^7.7.7",
|
|
61
|
+
"@babel/core": "^7.7.7",
|
|
62
|
+
"@babel/preset-env": "^7.7.7",
|
|
63
|
+
"@commitlint/cli": "^8.3.4",
|
|
64
|
+
"@commitlint/config-conventional": "^8.3.4",
|
|
65
|
+
"@webpack-contrib/defaults": "^6.3.0",
|
|
64
66
|
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
|
|
65
67
|
"babel-jest": "^24.9.0",
|
|
66
|
-
"commitlint-azure-pipelines-cli": "^1.0.
|
|
68
|
+
"commitlint-azure-pipelines-cli": "^1.0.3",
|
|
67
69
|
"cross-env": "^6.0.3",
|
|
68
70
|
"del": "^5.1.0",
|
|
69
71
|
"del-cli": "^3.0.0",
|
|
70
72
|
"es-check": "^5.1.0",
|
|
71
|
-
"eslint": "^6.
|
|
72
|
-
"eslint-config-prettier": "^6.
|
|
73
|
-
"eslint-plugin-import": "^2.
|
|
73
|
+
"eslint": "^6.8.0",
|
|
74
|
+
"eslint-config-prettier": "^6.9.0",
|
|
75
|
+
"eslint-plugin-import": "^2.19.1",
|
|
74
76
|
"file-loader": "^5.0.2",
|
|
75
|
-
"husky": "^
|
|
77
|
+
"husky": "^4.0.6",
|
|
76
78
|
"jest": "^24.9.0",
|
|
77
|
-
"jest-junit": "^
|
|
79
|
+
"jest-junit": "^10.0.0",
|
|
78
80
|
"lint-staged": "^9.5.0",
|
|
79
|
-
"
|
|
81
|
+
"memfs": "^3.0.3",
|
|
80
82
|
"npm-run-all": "^4.1.5",
|
|
81
83
|
"postcss-loader": "^3.0.0",
|
|
82
84
|
"postcss-preset-env": "^6.7.0",
|
|
83
85
|
"prettier": "^1.19.1",
|
|
84
|
-
"sass": "^1.
|
|
85
|
-
"sass-loader": "^8.0.
|
|
86
|
+
"sass": "^1.24.4",
|
|
87
|
+
"sass-loader": "^8.0.1",
|
|
86
88
|
"standard-version": "^7.0.1",
|
|
87
89
|
"strip-ansi": "^6.0.0",
|
|
88
90
|
"url-loader": "^3.0.0",
|
|
89
|
-
"webpack": "^4.41.
|
|
91
|
+
"webpack": "^4.41.5"
|
|
90
92
|
},
|
|
91
93
|
"keywords": [
|
|
92
94
|
"webpack",
|