Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbertoBrusa committed Apr 27, 2023
1 parent c675f8e commit 0c433d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export async function makeBundle(
const {
rootPackageWorkspaceDefinitions,
rootPackageJsonDependencies,
rootPackageJsonEngines,
packageJsons,
packageJsonsByPackagePath,
packageNames,
Expand All @@ -57,11 +56,6 @@ export async function makeBundle(

const packageJson = packageJsonsByPackagePath[packagePath];

// If engines field is not defined in the package's package.json, inherit it from the root package.json
if (!packageJson.engines) {
packageJson.engines = rootPackageJsonEngines;
}

const main = await getPackageEntryPoints(packagePath, includePrivate);

logger.log(`building ${packageName}...`);
Expand Down
4 changes: 4 additions & 0 deletions packages/modular-scripts/src/utils/getPackageMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ async function getPackageMetadata() {

Array.from(workspaces).forEach(([packageName, workspace]) => {
packageJsons[packageName] = workspace.rawPackageJson;
if (!packageJsons[packageName].engines) {
// If engines field is not defined in the package's package.json, inherit it from the root package.json
packageJsons[packageName].engines = rootPackageJsonEngines;
}
packageJsonsByPackagePath[workspace.location] = workspace.rawPackageJson;
});

Expand Down

0 comments on commit 0c433d9

Please sign in to comment.