Skip to content

Commit 117a97a

Browse files
fix: identifier for CssModule (#677)
1 parent 359c00f commit 117a97a

File tree

22 files changed

+1090
-1570
lines changed

22 files changed

+1090
-1570
lines changed

package-lock.json

Lines changed: 971 additions & 1441 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,35 +48,35 @@
4848
"webpack-sources": "^1.1.0"
4949
},
5050
"devDependencies": {
51-
"@babel/cli": "^7.12.1",
52-
"@babel/core": "^7.12.3",
53-
"@babel/preset-env": "^7.12.1",
51+
"@babel/cli": "^7.12.10",
52+
"@babel/core": "^7.12.10",
53+
"@babel/preset-env": "^7.12.11",
5454
"@commitlint/cli": "^11.0.0",
5555
"@commitlint/config-conventional": "^11.0.0",
5656
"@webpack-contrib/defaults": "^6.3.0",
5757
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
5858
"babel-eslint": "^10.1.0",
5959
"babel-jest": "^26.6.3",
6060
"bootstrap": "^4.5.3",
61-
"cross-env": "^7.0.2",
61+
"cross-env": "^7.0.3",
6262
"css-loader": "^5.0.1",
6363
"del": "^6.0.0",
6464
"del-cli": "^3.0.1",
65-
"es-check": "^5.1.2",
66-
"eslint": "^7.13.0",
67-
"eslint-config-prettier": "^6.15.0",
65+
"es-check": "^5.2.0",
66+
"eslint": "^7.17.0",
67+
"eslint-config-prettier": "^7.1.0",
6868
"eslint-plugin-import": "^2.22.1",
6969
"file-loader": "^6.2.0",
70-
"husky": "^4.3.0",
70+
"husky": "^4.3.7",
7171
"jest": "^26.6.3",
7272
"jsdom": "^16.4.0",
73-
"lint-staged": "^10.4.0",
73+
"lint-staged": "^10.5.3",
7474
"memfs": "^3.0.2",
7575
"npm-run-all": "^4.1.5",
76-
"prettier": "^2.1.2",
77-
"standard-version": "^9.0.0",
76+
"prettier": "^2.2.1",
77+
"standard-version": "^9.1.0",
7878
"webpack": "^5.9.0",
79-
"webpack-cli": "^4.2.0",
79+
"webpack-cli": "^4.3.1",
8080
"webpack-dev-server": "^3.7.2"
8181
},
8282
"keywords": [

src/CssModule.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class CssModule extends webpack.Module {
4242
}
4343

4444
identifier() {
45-
return `css ${this._identifier} ${this._identifierIndex}`;
45+
return `css|${this._identifier}|${this._identifierIndex}`;
4646
}
4747

4848
readableIdentifier(requestShortener) {
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
const webpack = require('webpack');
22

3-
module.exports = () => {
4-
return webpack.version[0] !== '4';
5-
};
3+
module.exports = () => webpack.version[0] !== '4';

test/cases/dependOn-multiple-files-per-entry/expected/webpack-5/common.js

Lines changed: 35 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ __webpack_require__.r(__webpack_exports__);
6363
/******/ // expose the modules object (__webpack_modules__)
6464
/******/ __webpack_require__.m = __webpack_modules__;
6565
/******/
66+
/******/ // the startup function
67+
/******/ // It's empty as some runtime module handles the default behavior
68+
/******/ __webpack_require__.x = x => {}
6669
/************************************************************************/
6770
/******/ /* webpack/runtime/hasOwnProperty shorthand */
6871
/******/ (() => {
@@ -105,43 +108,10 @@ __webpack_require__.r(__webpack_exports__);
105108
/******/
106109
/******/ // no HMR manifest
107110
/******/
108-
/******/ var checkDeferredModules = () => {
109-
/******/
110-
/******/ };
111-
/******/ function checkDeferredModulesImpl() {
112-
/******/ var result;
113-
/******/ for(var i = 0; i < deferredModules.length; i++) {
114-
/******/ var deferredModule = deferredModules[i];
115-
/******/ var fulfilled = true;
116-
/******/ for(var j = 1; j < deferredModule.length; j++) {
117-
/******/ var depId = deferredModule[j];
118-
/******/ if(installedChunks[depId] !== 0) fulfilled = false;
119-
/******/ }
120-
/******/ if(fulfilled) {
121-
/******/ deferredModules.splice(i--, 1);
122-
/******/ result = __webpack_require__(__webpack_require__.s = deferredModule[0]);
123-
/******/ }
124-
/******/ }
125-
/******/ if(deferredModules.length === 0) {
126-
/******/ __webpack_require__.x();
127-
/******/ __webpack_require__.x = () => {
128-
/******/
129-
/******/ }
130-
/******/ }
131-
/******/ return result;
132-
/******/ }
133-
/******/ __webpack_require__.x = () => {
134-
/******/ // reset startup function so it can be called again when more startup code is added
135-
/******/ __webpack_require__.x = () => {
136-
/******/
137-
/******/ }
138-
/******/ chunkLoadingGlobal = chunkLoadingGlobal.slice();
139-
/******/ for(var i = 0; i < chunkLoadingGlobal.length; i++) webpackJsonpCallback(chunkLoadingGlobal[i]);
140-
/******/ return (checkDeferredModules = checkDeferredModulesImpl)();
141-
/******/ };
111+
/******/ var checkDeferredModules = x => {};
142112
/******/
143113
/******/ // install a JSONP callback for chunk loading
144-
/******/ var webpackJsonpCallback = (data) => {
114+
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
145115
/******/ var [chunkIds, moreModules, runtime, executeModules] = data;
146116
/******/ // add "moreModules" to the modules object,
147117
/******/ // then flag all "chunkIds" as loaded and fire callback
@@ -159,7 +129,7 @@ __webpack_require__.r(__webpack_exports__);
159129
/******/ }
160130
/******/ }
161131
/******/ if(runtime) runtime(__webpack_require__);
162-
/******/ parentChunkLoadingFunction(data);
132+
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
163133
/******/ while(resolves.length) {
164134
/******/ resolves.shift()();
165135
/******/ }
@@ -172,8 +142,35 @@ __webpack_require__.r(__webpack_exports__);
172142
/******/ }
173143
/******/
174144
/******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || [];
175-
/******/ var parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);
176-
/******/ chunkLoadingGlobal.push = webpackJsonpCallback;
145+
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
146+
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
147+
/******/
148+
/******/ function checkDeferredModulesImpl() {
149+
/******/ var result;
150+
/******/ for(var i = 0; i < deferredModules.length; i++) {
151+
/******/ var deferredModule = deferredModules[i];
152+
/******/ var fulfilled = true;
153+
/******/ for(var j = 1; j < deferredModule.length; j++) {
154+
/******/ var depId = deferredModule[j];
155+
/******/ if(installedChunks[depId] !== 0) fulfilled = false;
156+
/******/ }
157+
/******/ if(fulfilled) {
158+
/******/ deferredModules.splice(i--, 1);
159+
/******/ result = __webpack_require__(__webpack_require__.s = deferredModule[0]);
160+
/******/ }
161+
/******/ }
162+
/******/ if(deferredModules.length === 0) {
163+
/******/ __webpack_require__.x();
164+
/******/ __webpack_require__.x = x => {};
165+
/******/ }
166+
/******/ return result;
167+
/******/ }
168+
/******/ var startup = __webpack_require__.x;
169+
/******/ __webpack_require__.x = () => {
170+
/******/ // reset startup function so it can be called again when more startup code is added
171+
/******/ __webpack_require__.x = startup || (x => {});
172+
/******/ return (checkDeferredModules = checkDeferredModulesImpl)();
173+
/******/ };
177174
/******/ })();
178175
/******/
179176
/************************************************************************/
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
const webpack = require('webpack');
22

3-
module.exports = () => {
4-
return webpack.version[0] !== '4';
5-
};
3+
module.exports = () => webpack.version[0] !== '4';

0 commit comments

Comments
 (0)