We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9d6c441 commit 49eb233Copy full SHA for 49eb233
src/utils/normalizeModuleFederationOptions.ts
@@ -131,12 +131,13 @@ function normalizeShareItem(
131
}
132
): ShareItem {
133
let version: string | undefined;
134
- try {
135
- const npmPackage = removePathFromNpmPackage(key);
136
- // TODO get current package version
137
- version = npmPackage ? require(path.join(npmPackage, 'package.json')).version : undefined;
138
- } catch (e) {
139
- console.log(e);
+ const npmPackage = removePathFromNpmPackage(key);
+ if (npmPackage) {
+ try {
+ version = require(path.join(npmPackage, 'package.json')).version;
+ } catch (e) {
+ console.log(e);
140
+ }
141
142
if (typeof shareItem === 'string') {
143
return {
0 commit comments