Skip to content

Commit

Permalink
fix: compatibility with named export and es5
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Apr 28, 2021
1 parent e0d834d commit 79b44f1
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/loader.js
Expand Up @@ -155,7 +155,7 @@ export function pitch(request) {
? namedExport
? Object.keys(locals)
.map(
(key) => `\nexport const ${key} = ${JSON.stringify(locals[key])};`
(key) => `\nexport var ${key} = ${JSON.stringify(locals[key])};`
)
.join('')
: `\n${
Expand Down
Expand Up @@ -116,13 +116,13 @@ __webpack_require__.d(index_namespaceObject, "b", function() { return b_namespac

// CONCATENATED MODULE: ./a.css
// extracted by mini-css-extract-plugin
const a = "foo__a";
var a = "foo__a";
// CONCATENATED MODULE: ./b.css
// extracted by mini-css-extract-plugin
const b = "foo__b";
var b = "foo__b";
// CONCATENATED MODULE: ./c.css
// extracted by mini-css-extract-plugin
const c = "foo__c";
var c = "foo__c";
// CONCATENATED MODULE: ./index.js
/* eslint-disable import/no-namespace */

Expand Down
Expand Up @@ -69,13 +69,13 @@ __webpack_require__.d(index_namespaceObject, {

;// CONCATENATED MODULE: ./a.css
// extracted by mini-css-extract-plugin
const a = "foo__a";
var a = "foo__a";
;// CONCATENATED MODULE: ./b.css
// extracted by mini-css-extract-plugin
const b = "foo__b";
var b = "foo__b";
;// CONCATENATED MODULE: ./c.css
// extracted by mini-css-extract-plugin
const c = "foo__c";
var c = "foo__c";
;// CONCATENATED MODULE: ./index.js
/* eslint-disable import/no-namespace */

Expand Down
Expand Up @@ -69,13 +69,13 @@ __webpack_require__.d(index_namespaceObject, {

;// CONCATENATED MODULE: ./a.css
// extracted by mini-css-extract-plugin
const a = "foo__a";
var a = "foo__a";
;// CONCATENATED MODULE: ./b.css
// extracted by mini-css-extract-plugin
const b = "foo__b";
var b = "foo__b";
;// CONCATENATED MODULE: ./c.css
// extracted by mini-css-extract-plugin
const c = "foo__c";
var c = "foo__c";
;// CONCATENATED MODULE: ./index.js
/* eslint-disable import/no-namespace */

Expand Down
6 changes: 3 additions & 3 deletions test/cases/es-named-export-output-module/expected/main.js
Expand Up @@ -11,9 +11,9 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export */ "cClass": () => (/* binding */ cClass)
/* harmony export */ });
// extracted by mini-css-extract-plugin
const aClass = "foo__style__a-class";
const bClass = "foo__style__b__class";
const cClass = "foo__style__cClass";
var aClass = "foo__style__a-class";
var bClass = "foo__style__b__class";
var cClass = "foo__style__cClass";

/***/ })
/******/ ]);
Expand Down
6 changes: 3 additions & 3 deletions test/cases/es-named-export/expected/webpack-4/main.js
Expand Up @@ -107,9 +107,9 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bClass", function() { return bClass; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cClass", function() { return cClass; });
// extracted by mini-css-extract-plugin
const aClass = "foo__style__a-class";
const bClass = "foo__style__b__class";
const cClass = "foo__style__cClass";
var aClass = "foo__style__a-class";
var bClass = "foo__style__b__class";
var cClass = "foo__style__cClass";

/***/ })
/******/ ]);
Expand Up @@ -12,9 +12,9 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export */ "cClass": () => (/* binding */ cClass)
/* harmony export */ });
// extracted by mini-css-extract-plugin
const aClass = "foo__style__a-class";
const bClass = "foo__style__b__class";
const cClass = "foo__style__cClass";
var aClass = "foo__style__a-class";
var bClass = "foo__style__b__class";
var cClass = "foo__style__cClass";

/***/ })
/******/ ]);
Expand Down
6 changes: 3 additions & 3 deletions test/cases/es-named-export/expected/webpack-5/main.js
Expand Up @@ -12,9 +12,9 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export */ "cClass": () => (/* binding */ cClass)
/* harmony export */ });
// extracted by mini-css-extract-plugin
const aClass = "foo__style__a-class";
const bClass = "foo__style__b__class";
const cClass = "foo__style__cClass";
var aClass = "foo__style__a-class";
var bClass = "foo__style__b__class";
var cClass = "foo__style__cClass";

/***/ })
/******/ ]);
Expand Down

0 comments on commit 79b44f1

Please sign in to comment.