From b656c5c98dcffcae51f5208e961ce089be6607a8 Mon Sep 17 00:00:00 2001 From: Alexander Akait <4567934+alexander-akait@users.noreply.github.com> Date: Thu, 1 Feb 2024 19:26:33 +0300 Subject: [PATCH] feat: support named exports with any characters --- package-lock.json | 24 ++--- package.json | 2 +- src/loader.js | 46 +++++++--- .../expected/main.js | 10 +- .../expected/main.js | 20 ++-- .../expected/main.css | 12 +++ .../expected/main.mjs | 87 ++++++++++++++++++ .../index.js | 8 ++ .../style.css | 11 +++ .../webpack.config.js | 38 ++++++++ .../es-named-export-as-is/expected/main.css | 12 +++ .../es-named-export-as-is/expected/main.js | 91 +++++++++++++++++++ test/cases/es-named-export-as-is/index.js | 8 ++ test/cases/es-named-export-as-is/style.css | 11 +++ .../es-named-export-as-is/webpack.config.js | 32 +++++++ .../expected/main.mjs | 14 +-- test/cases/es-named-export/expected/main.js | 14 +-- test/cases/es-named-export/webpack.config.js | 1 + .../expected/main.js | 14 +-- 19 files changed, 401 insertions(+), 54 deletions(-) create mode 100644 test/cases/es-named-export-as-is-output-module/expected/main.css create mode 100644 test/cases/es-named-export-as-is-output-module/expected/main.mjs create mode 100644 test/cases/es-named-export-as-is-output-module/index.js create mode 100644 test/cases/es-named-export-as-is-output-module/style.css create mode 100644 test/cases/es-named-export-as-is-output-module/webpack.config.js create mode 100644 test/cases/es-named-export-as-is/expected/main.css create mode 100644 test/cases/es-named-export-as-is/expected/main.js create mode 100644 test/cases/es-named-export-as-is/index.js create mode 100644 test/cases/es-named-export-as-is/style.css create mode 100644 test/cases/es-named-export-as-is/webpack.config.js diff --git a/package-lock.json b/package-lock.json index 37cb0023..9c58966c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5228,16 +5228,16 @@ } }, "css-loader": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-6.9.0.tgz", - "integrity": "sha512-3I5Nu4ytWlHvOP6zItjiHlefBNtrH+oehq8tnQa2kO305qpVyx9XNIT1CXIj5bgCJs7qICBCkgCYxQLKPANoLA==", + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-6.10.0.tgz", + "integrity": "sha512-LTSA/jWbwdMlk+rhmElbDR2vbtQoTBPr7fkJE+mxrHj+7ru0hUmHafDRzWIjIHTwpitWVaqY2/UWGRca3yUgRw==", "dev": true, "requires": { "icss-utils": "^5.1.0", - "postcss": "^8.4.31", + "postcss": "^8.4.33", "postcss-modules-extract-imports": "^3.0.0", - "postcss-modules-local-by-default": "^4.0.3", - "postcss-modules-scope": "^3.1.0", + "postcss-modules-local-by-default": "^4.0.4", + "postcss-modules-scope": "^3.1.1", "postcss-modules-values": "^4.0.0", "postcss-value-parser": "^4.2.0", "semver": "^7.5.4" @@ -10471,9 +10471,9 @@ "dev": true }, "postcss-modules-local-by-default": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.0.3.tgz", - "integrity": "sha512-2/u2zraspoACtrbFRnTijMiQtb4GW4BvatjaG/bCjYQo8kLTdevCUlwuBHx2sCnSyrI3x3qj4ZK1j5LQBgzmwA==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.0.4.tgz", + "integrity": "sha512-L4QzMnOdVwRm1Qb8m4x8jsZzKAaPAgrUF1r/hjDR2Xj7R+8Zsf97jAlSQzWtKx5YNiNGN8QxmPFIc/sh+RQl+Q==", "dev": true, "requires": { "icss-utils": "^5.0.0", @@ -10482,9 +10482,9 @@ } }, "postcss-modules-scope": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-3.1.0.tgz", - "integrity": "sha512-SaIbK8XW+MZbd0xHPf7kdfA/3eOt7vxJ72IRecn3EzuZVLr1r0orzf0MX/pN8m+NMDoo6X/SQd8oeKqGZd8PXg==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-3.1.1.tgz", + "integrity": "sha512-uZgqzdTleelWjzJY+Fhti6F3C9iF1JR/dODLs/JDefozYcKTBCdD8BIl6nNPbTbcLnGrk56hzwZC2DaGNvYjzA==", "dev": true, "requires": { "postcss-selector-parser": "^6.0.4" diff --git a/package.json b/package.json index a9e822f0..2c19434d 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "bootstrap": "^4.6.2", "cross-env": "^7.0.3", "cspell": "^6.31.1", - "css-loader": "^6.9.0", + "css-loader": "^6.10.0", "del": "^6.0.0", "del-cli": "^4.0.0", "es-check": "^7.1.0", diff --git a/src/loader.js b/src/loader.js index e0ae6f84..35d8a9ba 100644 --- a/src/loader.js +++ b/src/loader.js @@ -245,22 +245,44 @@ function pitch(request) { return; } - const result = locals - ? namedExport - ? Object.keys(locals) + const result = (function makeResult() { + if (locals) { + if (namedExport) { + const identifiers = Array.from( + (function* generateIdentifiers() { + let identifierId = 0; + + for (const key of Object.keys(locals)) { + identifierId += 1; + + yield [`_${identifierId.toString(16)}`, key]; + } + })() + ); + + const localsString = identifiers .map( - (key) => - `\nexport var ${key} = ${stringifyLocal( + ([id, key]) => + `\nvar ${id} = ${stringifyLocal( /** @type {Locals} */ (locals)[key] )};` ) - .join("") - : `\n${ - esModule ? "export default" : "module.exports =" - } ${JSON.stringify(locals)};` - : esModule - ? `\nexport {};` - : ""; + .join(""); + const exportsString = `export { ${identifiers + .map(([id, key]) => `${id} as ${JSON.stringify(key)}`) + .join(", ")} }`; + + return `${localsString}\n${exportsString}\n`; + } + + return `\n${ + esModule ? "export default" : "module.exports = " + } ${JSON.stringify(locals)};`; + } else if (esModule) { + return "\nexport {};"; + } + return ""; + })(); let resultSource = `// extracted by ${MiniCssExtractPlugin.pluginName}`; diff --git a/test/cases/custom-loader-with-functional-exports/expected/main.js b/test/cases/custom-loader-with-functional-exports/expected/main.js index a25ef24d..e3e3d2ff 100644 --- a/test/cases/custom-loader-with-functional-exports/expected/main.js +++ b/test/cases/custom-loader-with-functional-exports/expected/main.js @@ -7,12 +7,14 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ cnA: () => (/* binding */ cnA), -/* harmony export */ cnB: () => (/* binding */ cnB) +/* harmony export */ cnA: () => (/* binding */ _1), +/* harmony export */ cnB: () => (/* binding */ _2) /* harmony export */ }); // extracted by mini-css-extract-plugin -var cnA = () => "class-name-a"; -var cnB = () => "class-name-b"; +var _1 = () => "class-name-a"; +var _2 = () => "class-name-b"; + + /***/ }) /******/ ]); diff --git a/test/cases/es-module-concatenation-modules/expected/main.js b/test/cases/es-module-concatenation-modules/expected/main.js index 71f38e53..918474db 100644 --- a/test/cases/es-module-concatenation-modules/expected/main.js +++ b/test/cases/es-module-concatenation-modules/expected/main.js @@ -41,21 +41,21 @@ __webpack_require__.r(__webpack_exports__); __webpack_require__.d(__webpack_exports__, { a: () => (/* reexport */ a_namespaceObject), b: () => (/* reexport */ b_namespaceObject), - c: () => (/* reexport */ c) + c: () => (/* reexport */ c_1) }); // NAMESPACE OBJECT: ./a.css var a_namespaceObject = {}; __webpack_require__.r(a_namespaceObject); __webpack_require__.d(a_namespaceObject, { - a: () => (a) + a: () => (_1) }); // NAMESPACE OBJECT: ./b.css var b_namespaceObject = {}; __webpack_require__.r(b_namespaceObject); __webpack_require__.d(b_namespaceObject, { - b: () => (b) + b: () => (b_1) }); // NAMESPACE OBJECT: ./index.js @@ -64,18 +64,24 @@ __webpack_require__.r(index_namespaceObject); __webpack_require__.d(index_namespaceObject, { a: () => (a_namespaceObject), b: () => (b_namespaceObject), - c: () => (c) + c: () => (c_1) }); ;// CONCATENATED MODULE: ./a.css // extracted by mini-css-extract-plugin -var a = "foo__a"; +var _1 = "foo__a"; + + ;// CONCATENATED MODULE: ./b.css // extracted by mini-css-extract-plugin -var b = "foo__b"; +var b_1 = "foo__b"; + + ;// CONCATENATED MODULE: ./c.css // extracted by mini-css-extract-plugin -var c = "foo__c"; +var c_1 = "foo__c"; + + ;// CONCATENATED MODULE: ./index.js /* eslint-disable import/no-namespace */ diff --git a/test/cases/es-named-export-as-is-output-module/expected/main.css b/test/cases/es-named-export-as-is-output-module/expected/main.css new file mode 100644 index 00000000..b9a7e294 --- /dev/null +++ b/test/cases/es-named-export-as-is-output-module/expected/main.css @@ -0,0 +1,12 @@ +.Xh041yLR4iCP4RGjge50 { + background: red; +} + +.NMuRsxoDwvW8BhSXhFAY { + color: green; +} + +.ayWIv09rPsAqE2JznIsI { + color: blue; +} + diff --git a/test/cases/es-named-export-as-is-output-module/expected/main.mjs b/test/cases/es-named-export-as-is-output-module/expected/main.mjs new file mode 100644 index 00000000..dd030372 --- /dev/null +++ b/test/cases/es-named-export-as-is-output-module/expected/main.mjs @@ -0,0 +1,87 @@ +/******/ var __webpack_modules__ = ([ +/* 0 */, +/* 1 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "a-class": () => (/* binding */ _1), +/* harmony export */ b__class: () => (/* binding */ _2), +/* harmony export */ cClass: () => (/* binding */ _3) +/* harmony export */ }); +// extracted by mini-css-extract-plugin +var _1 = "Xh041yLR4iCP4RGjge50"; +var _2 = "NMuRsxoDwvW8BhSXhFAY"; +var _3 = "ayWIv09rPsAqE2JznIsI"; + + + +/***/ }) +/******/ ]); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. +(() => { +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _style_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); + + +// eslint-disable-next-line no-console +console.log({ css: _style_css__WEBPACK_IMPORTED_MODULE_0__["default"], aClass: _style_css__WEBPACK_IMPORTED_MODULE_0__["a-class"], bClass: _style_css__WEBPACK_IMPORTED_MODULE_0__.b__class, cClass: _style_css__WEBPACK_IMPORTED_MODULE_0__.cClass }); + +})(); + diff --git a/test/cases/es-named-export-as-is-output-module/index.js b/test/cases/es-named-export-as-is-output-module/index.js new file mode 100644 index 00000000..aa114287 --- /dev/null +++ b/test/cases/es-named-export-as-is-output-module/index.js @@ -0,0 +1,8 @@ +import css, { + "a-class" as aClass, + "b__class" as bClass, + cClass, +} from "./style.css"; + +// eslint-disable-next-line no-console +console.log({ css, aClass, bClass, cClass }); diff --git a/test/cases/es-named-export-as-is-output-module/style.css b/test/cases/es-named-export-as-is-output-module/style.css new file mode 100644 index 00000000..a9085408 --- /dev/null +++ b/test/cases/es-named-export-as-is-output-module/style.css @@ -0,0 +1,11 @@ +.a-class { + background: red; +} + +.b__class { + color: green; +} + +.cClass { + color: blue; +} diff --git a/test/cases/es-named-export-as-is-output-module/webpack.config.js b/test/cases/es-named-export-as-is-output-module/webpack.config.js new file mode 100644 index 00000000..2f78afe7 --- /dev/null +++ b/test/cases/es-named-export-as-is-output-module/webpack.config.js @@ -0,0 +1,38 @@ +import Self from "../../../src"; + +module.exports = { + entry: "./index.js", + module: { + rules: [ + { + test: /\.css$/, + use: [ + { + loader: Self.loader, + }, + { + loader: "css-loader", + options: { + esModule: true, + modules: { + namedExport: true, + exportLocalsConvention: "asIs", + }, + }, + }, + ], + }, + ], + }, + output: { + module: true, + }, + experiments: { + outputModule: true, + }, + plugins: [ + new Self({ + filename: "[name].css", + }), + ], +}; diff --git a/test/cases/es-named-export-as-is/expected/main.css b/test/cases/es-named-export-as-is/expected/main.css new file mode 100644 index 00000000..b9a7e294 --- /dev/null +++ b/test/cases/es-named-export-as-is/expected/main.css @@ -0,0 +1,12 @@ +.Xh041yLR4iCP4RGjge50 { + background: red; +} + +.NMuRsxoDwvW8BhSXhFAY { + color: green; +} + +.ayWIv09rPsAqE2JznIsI { + color: blue; +} + diff --git a/test/cases/es-named-export-as-is/expected/main.js b/test/cases/es-named-export-as-is/expected/main.js new file mode 100644 index 00000000..a17ffa68 --- /dev/null +++ b/test/cases/es-named-export-as-is/expected/main.js @@ -0,0 +1,91 @@ +/******/ (() => { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ([ +/* 0 */, +/* 1 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "a-class": () => (/* binding */ _1), +/* harmony export */ b__class: () => (/* binding */ _2), +/* harmony export */ cClass: () => (/* binding */ _3) +/* harmony export */ }); +// extracted by mini-css-extract-plugin +var _1 = "Xh041yLR4iCP4RGjge50"; +var _2 = "NMuRsxoDwvW8BhSXhFAY"; +var _3 = "ayWIv09rPsAqE2JznIsI"; + + + +/***/ }) +/******/ ]); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. +(() => { +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _style_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); + + +// eslint-disable-next-line no-console +console.log({ css: _style_css__WEBPACK_IMPORTED_MODULE_0__["default"], aClass: _style_css__WEBPACK_IMPORTED_MODULE_0__["a-class"], bClass: _style_css__WEBPACK_IMPORTED_MODULE_0__.b__class, cClass: _style_css__WEBPACK_IMPORTED_MODULE_0__.cClass }); + +})(); + +/******/ })() +; \ No newline at end of file diff --git a/test/cases/es-named-export-as-is/index.js b/test/cases/es-named-export-as-is/index.js new file mode 100644 index 00000000..aa114287 --- /dev/null +++ b/test/cases/es-named-export-as-is/index.js @@ -0,0 +1,8 @@ +import css, { + "a-class" as aClass, + "b__class" as bClass, + cClass, +} from "./style.css"; + +// eslint-disable-next-line no-console +console.log({ css, aClass, bClass, cClass }); diff --git a/test/cases/es-named-export-as-is/style.css b/test/cases/es-named-export-as-is/style.css new file mode 100644 index 00000000..a9085408 --- /dev/null +++ b/test/cases/es-named-export-as-is/style.css @@ -0,0 +1,11 @@ +.a-class { + background: red; +} + +.b__class { + color: green; +} + +.cClass { + color: blue; +} diff --git a/test/cases/es-named-export-as-is/webpack.config.js b/test/cases/es-named-export-as-is/webpack.config.js new file mode 100644 index 00000000..e7a1091f --- /dev/null +++ b/test/cases/es-named-export-as-is/webpack.config.js @@ -0,0 +1,32 @@ +import Self from "../../../src"; + +module.exports = { + entry: "./index.js", + module: { + rules: [ + { + test: /\.css$/, + use: [ + { + loader: Self.loader, + }, + { + loader: "css-loader", + options: { + esModule: true, + modules: { + namedExport: true, + exportLocalsConvention: "asIs", + }, + }, + }, + ], + }, + ], + }, + plugins: [ + new Self({ + filename: "[name].css", + }), + ], +}; diff --git a/test/cases/es-named-export-output-module/expected/main.mjs b/test/cases/es-named-export-output-module/expected/main.mjs index 1f78824d..eea1b171 100644 --- a/test/cases/es-named-export-output-module/expected/main.mjs +++ b/test/cases/es-named-export-output-module/expected/main.mjs @@ -5,14 +5,16 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ aClass: () => (/* binding */ aClass), -/* harmony export */ bClass: () => (/* binding */ bClass), -/* harmony export */ cClass: () => (/* binding */ cClass) +/* harmony export */ aClass: () => (/* binding */ _1), +/* harmony export */ bClass: () => (/* binding */ _2), +/* harmony export */ cClass: () => (/* binding */ _3) /* harmony export */ }); // extracted by mini-css-extract-plugin -var aClass = "foo__style__a-class"; -var bClass = "foo__style__b__class"; -var cClass = "foo__style__cClass"; +var _1 = "foo__style__a-class"; +var _2 = "foo__style__b__class"; +var _3 = "foo__style__cClass"; + + /***/ }) /******/ ]); diff --git a/test/cases/es-named-export/expected/main.js b/test/cases/es-named-export/expected/main.js index a5118432..08202354 100644 --- a/test/cases/es-named-export/expected/main.js +++ b/test/cases/es-named-export/expected/main.js @@ -7,14 +7,16 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ aClass: () => (/* binding */ aClass), -/* harmony export */ bClass: () => (/* binding */ bClass), -/* harmony export */ cClass: () => (/* binding */ cClass) +/* harmony export */ "a-class": () => (/* binding */ _1), +/* harmony export */ b__class: () => (/* binding */ _2), +/* harmony export */ cClass: () => (/* binding */ _3) /* harmony export */ }); // extracted by mini-css-extract-plugin -var aClass = "foo__style__a-class"; -var bClass = "foo__style__b__class"; -var cClass = "foo__style__cClass"; +var _1 = "foo__style__a-class"; +var _2 = "foo__style__b__class"; +var _3 = "foo__style__cClass"; + + /***/ }) /******/ ]); diff --git a/test/cases/es-named-export/webpack.config.js b/test/cases/es-named-export/webpack.config.js index 6ab62bc2..49f0c3c6 100644 --- a/test/cases/es-named-export/webpack.config.js +++ b/test/cases/es-named-export/webpack.config.js @@ -16,6 +16,7 @@ module.exports = { esModule: true, modules: { namedExport: true, + exportLocalsConvention: "asIs", localIdentName: "foo__[name]__[local]", }, }, diff --git a/test/cases/export-only-locals-and-es-named-export/expected/main.js b/test/cases/export-only-locals-and-es-named-export/expected/main.js index 15e05d5f..fc556c4f 100644 --- a/test/cases/export-only-locals-and-es-named-export/expected/main.js +++ b/test/cases/export-only-locals-and-es-named-export/expected/main.js @@ -7,14 +7,16 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ aClass: () => (/* binding */ aClass), -/* harmony export */ bClass: () => (/* binding */ bClass), -/* harmony export */ cClass: () => (/* binding */ cClass) +/* harmony export */ aClass: () => (/* binding */ _1), +/* harmony export */ bClass: () => (/* binding */ _2), +/* harmony export */ cClass: () => (/* binding */ _3) /* harmony export */ }); // extracted by mini-css-extract-plugin -var aClass = "foo__style__a-class"; -var bClass = "foo__style__b__class"; -var cClass = "foo__style__cClass"; +var _1 = "foo__style__a-class"; +var _2 = "foo__style__b__class"; +var _3 = "foo__style__cClass"; + + /***/ }) /******/ ]);