Skip to content

Commit

Permalink
Merge pull request #9260 from webpack/fix-9044
Browse files Browse the repository at this point in the history
fix(mjs): remove harmony unused build errors
  • Loading branch information
sokra committed Jun 12, 2019
2 parents acf2c2d + 8d5ad83 commit 55f18f9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 17 deletions.
6 changes: 2 additions & 4 deletions lib/dependencies/HarmonyExportImportedSpecifierDependency.js
Expand Up @@ -355,15 +355,13 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency {
// It's not an harmony module
if (
this.originModule.buildMeta.strictHarmonyModule &&
this._id &&
this._id !== "default"
) {
// In strict harmony modules we only support the default export
const exportName = this._id
? `the named export '${this._id}'`
: "the namespace object";
return [
new HarmonyLinkingError(
`Can't reexport ${exportName} from non EcmaScript module (only default export is available)`
`Can't reexport the named export '${this._id}' from non EcmaScript module (only default export is available)`
)
];
}
Expand Down
6 changes: 2 additions & 4 deletions lib/dependencies/HarmonyImportSpecifierDependency.js
Expand Up @@ -80,15 +80,13 @@ class HarmonyImportSpecifierDependency extends HarmonyImportDependency {
// It's not an harmony module
if (
this.originModule.buildMeta.strictHarmonyModule &&
this._id &&
this._id !== "default"
) {
// In strict harmony modules we only support the default export
const exportName = this._id
? `the named export '${this._id}'`
: "the namespace object";
return [
new HarmonyLinkingError(
`Can't import ${exportName} from non EcmaScript module (only default export is available)`
`Can't import the named export '${this._id}' from non EcmaScript module (only default export is available)`
)
];
}
Expand Down
9 changes: 0 additions & 9 deletions test/cases/mjs/cjs-import-default/errors.js
@@ -1,19 +1,10 @@
module.exports = [
[
/Can't import the namespace object from non EcmaScript module \(only default export is available\)/
],
[
/Can't import the namespace object from non EcmaScript module \(only default export is available\)/
],
[
/Can't import the named export 'data' from non EcmaScript module \(only default export is available\)/
],
[
/Can't import the named export 'data' from non EcmaScript module \(only default export is available\)/
],
[
/Can't reexport the namespace object from non EcmaScript module \(only default export is available\)/
],
[
/Can't reexport the named export 'data' from non EcmaScript module \(only default export is available\)/
]
Expand Down

0 comments on commit 55f18f9

Please sign in to comment.