Skip to content

Commit f3f1bfe

Browse files
committed
fix(nf): always compile shared deps for prod
1 parent dbc493a commit f3f1bfe

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

libs/native-federation-core/src/lib/utils/package-info.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,17 @@ export function _getPackageInfo(
228228

229229
cand = mainPkgJson?.exports?.[relSecondaryPath]?.default;
230230
if (cand) {
231+
232+
if (typeof cand === 'object') {
233+
if (cand.module) {
234+
cand = cand.module;
235+
} else if (cand.default) {
236+
cand = cand.default;
237+
} else {
238+
cand = null;
239+
}
240+
}
241+
231242
return {
232243
entryPoint: path.join(mainPkgPath, cand),
233244
packageName,

libs/native-federation/src/utils/angular-esbuild-adapter.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,6 @@ async function runEsbuild(
114114
const browsers = getSupportedBrowsers(projectRoot, context.logger as any);
115115
const target = transformSupportedBrowsersToTargets(browsers);
116116

117-
const optimizeScripts =
118-
(typeof builderOptions.optimization === 'boolean' &&
119-
builderOptions.optimization) ||
120-
(typeof builderOptions.optimization !== 'boolean' &&
121-
builderOptions.optimization.scripts);
122-
123117
return await esbuild.build({
124118
entryPoints: [entryPoint],
125119
absWorkingDir,
@@ -158,9 +152,7 @@ async function runEsbuild(
158152
: []),
159153
],
160154
define: {
161-
...(optimizeScripts
162-
? { ngDevMode: 'false' }
163-
: undefined),
155+
ngDevMode: 'false',
164156
ngJitMode: 'false',
165157
},
166158
});

0 commit comments

Comments
 (0)