css-loader 3.4.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 CHANGED
@@ -2,6 +2,13 @@
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
+
5
12
  ### [3.4.1](https://github.com/webpack-contrib/css-loader/compare/v3.4.0...v3.4.1) (2020-01-03)
6
13
 
7
14
 
@@ -23,14 +23,32 @@ 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, '']];
30
30
  }
31
31
 
32
- for (var i = 0; i < modules.length; i++) {
33
- var item = [].concat(modules[i]);
32
+ var alreadyImportedModules = {};
33
+
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];
38
+
39
+ if (id != null) {
40
+ alreadyImportedModules[id] = true;
41
+ }
42
+ }
43
+ }
44
+
45
+ for (var _i = 0; _i < modules.length; _i++) {
46
+ var item = [].concat(modules[_i]);
47
+
48
+ if (dedupe && alreadyImportedModules[item[0]]) {
49
+ // eslint-disable-next-line no-continue
50
+ continue;
51
+ }
34
52
 
35
53
  if (mediaQuery) {
36
54
  if (!item[2]) {
package/dist/utils.js CHANGED
@@ -255,7 +255,7 @@ 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);
@@ -264,7 +264,7 @@ function getImportCode(loaderContext, imports, exportType, sourceMap, importLoad
264
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "css-loader",
3
- "version": "3.4.1",
3
+ "version": "3.4.2",
4
4
  "description": "css loader module for webpack",
5
5
  "license": "MIT",
6
6
  "repository": "webpack-contrib/css-loader",
@@ -57,38 +57,38 @@
57
57
  "schema-utils": "^2.6.0"
58
58
  },
59
59
  "devDependencies": {
60
- "@babel/cli": "^7.7.4",
61
- "@babel/core": "^7.7.4",
62
- "@babel/preset-env": "^7.7.4",
63
- "@commitlint/cli": "^8.2.0",
64
- "@commitlint/config-conventional": "^8.2.0",
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
65
  "@webpack-contrib/defaults": "^6.3.0",
66
66
  "@webpack-contrib/eslint-config-webpack": "^3.0.0",
67
67
  "babel-jest": "^24.9.0",
68
- "commitlint-azure-pipelines-cli": "^1.0.2",
68
+ "commitlint-azure-pipelines-cli": "^1.0.3",
69
69
  "cross-env": "^6.0.3",
70
70
  "del": "^5.1.0",
71
71
  "del-cli": "^3.0.0",
72
72
  "es-check": "^5.1.0",
73
- "eslint": "^6.7.1",
74
- "eslint-config-prettier": "^6.7.0",
75
- "eslint-plugin-import": "^2.18.2",
73
+ "eslint": "^6.8.0",
74
+ "eslint-config-prettier": "^6.9.0",
75
+ "eslint-plugin-import": "^2.19.1",
76
76
  "file-loader": "^5.0.2",
77
- "husky": "^3.1.0",
77
+ "husky": "^4.0.6",
78
78
  "jest": "^24.9.0",
79
79
  "jest-junit": "^10.0.0",
80
80
  "lint-staged": "^9.5.0",
81
- "memfs": "^3.0.1",
81
+ "memfs": "^3.0.3",
82
82
  "npm-run-all": "^4.1.5",
83
83
  "postcss-loader": "^3.0.0",
84
84
  "postcss-preset-env": "^6.7.0",
85
85
  "prettier": "^1.19.1",
86
- "sass": "^1.23.7",
87
- "sass-loader": "^8.0.0",
86
+ "sass": "^1.24.4",
87
+ "sass-loader": "^8.0.1",
88
88
  "standard-version": "^7.0.1",
89
89
  "strip-ansi": "^6.0.0",
90
90
  "url-loader": "^3.0.0",
91
- "webpack": "^4.41.3"
91
+ "webpack": "^4.41.5"
92
92
  },
93
93
  "keywords": [
94
94
  "webpack",