Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: compatibility with named export and es5 #751

Merged
merged 1 commit into from Apr 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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