Skip to content

Commit 5c8a4bb

Browse files
committed
Unify Dependency#getExports result
1 parent b6042fb commit 5c8a4bb

File tree

6 files changed

+18
-14
lines changed

6 files changed

+18
-14
lines changed

lib/NormalModuleFactory.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,17 @@ const loaderToIdent = data => {
3131

3232
const identToLoaderRequest = resultString => {
3333
const idx = resultString.indexOf("?");
34-
let options;
35-
3634
if (idx >= 0) {
37-
options = resultString.substr(idx + 1);
38-
resultString = resultString.substr(0, idx);
39-
35+
const loader = resultString.substr(0, idx);
36+
const options = resultString.substr(idx + 1);
4037
return {
41-
loader: resultString,
38+
loader,
4239
options
4340
};
4441
} else {
4542
return {
4643
loader: resultString,
47-
options
44+
options: undefined
4845
};
4946
}
5047
};

lib/dependencies/DelegatedExportsDependency.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ class DelegatedExportsDependency extends NullDependency {
2424

2525
getExports() {
2626
return {
27-
exports: this.exports
27+
exports: this.exports,
28+
dependencies: undefined
2829
};
2930
}
3031
}

lib/dependencies/HarmonyExportExpressionDependency.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ class HarmonyExportExpressionDependency extends NullDependency {
1919

2020
getExports() {
2121
return {
22-
exports: ["default"]
22+
exports: ["default"],
23+
dependencies: undefined
2324
};
2425
}
2526
}

lib/dependencies/HarmonyExportImportedSpecifierDependency.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,8 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency {
252252
getExports() {
253253
if (this.name) {
254254
return {
255-
exports: [this.name]
255+
exports: [this.name],
256+
dependencies: undefined
256257
};
257258
}
258259

@@ -261,7 +262,8 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency {
261262
if (!importedModule) {
262263
// no imported module available
263264
return {
264-
exports: null
265+
exports: null,
266+
dependencies: undefined
265267
};
266268
}
267269

@@ -276,7 +278,8 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency {
276278

277279
if (importedModule.buildMeta.providedExports) {
278280
return {
279-
exports: true
281+
exports: true,
282+
dependencies: undefined
280283
};
281284
}
282285

lib/dependencies/HarmonyExportSpecifierDependency.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ class HarmonyExportSpecifierDependency extends NullDependency {
1919

2020
getExports() {
2121
return {
22-
exports: [this.name]
22+
exports: [this.name],
23+
dependencies: undefined
2324
};
2425
}
2526
}

lib/dependencies/JsonExportsDependency.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ class JsonExportsDependency extends NullDependency {
1717

1818
getExports() {
1919
return {
20-
exports: this.exports
20+
exports: this.exports,
21+
dependencies: undefined
2122
};
2223
}
2324
}

0 commit comments

Comments
 (0)