Skip to content

Commit b0af85a

Browse files
author
Alejandro
committed
feat(nf): unhides bundle adapter errors when building artifacts
1 parent 3aecbb2 commit b0af85a

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

libs/native-federation-core/src/lib/core/bundle-exposed-and-mappings.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import path from 'path';
21
import fs from 'fs';
2+
import path from 'path';
33

4-
import { NormalizedFederationConfig } from '../config/federation-config';
5-
import { FederationOptions } from './federation-options';
6-
import { bundle } from '../utils/build-utils';
74
import { ExposesInfo, SharedInfo } from '@softarc/native-federation-runtime';
5+
import { NormalizedFederationConfig } from '../config/federation-config';
86
import {
97
createBuildResultMap,
108
lookupInResultMap,
119
} from '../utils/build-result-map';
10+
import { bundle } from '../utils/build-utils';
1211
import { logger } from '../utils/logger';
1312
import { normalize } from '../utils/normalize';
13+
import { FederationOptions } from './federation-options';
1414

1515
export interface ArtefactInfo {
1616
mappings: SharedInfo[];
@@ -40,7 +40,9 @@ export async function bundleExposedAndMappings(
4040

4141
logger.info('Building federation artefacts');
4242

43-
const result = await bundle({
43+
let result;
44+
try {
45+
result = await bundle({
4446
entryPoints,
4547
outdir: fedOptions.outputPath,
4648
tsConfigPath: fedOptions.tsConfig,
@@ -50,8 +52,12 @@ export async function bundleExposedAndMappings(
5052
mappedPaths: config.sharedMappings,
5153
kind: 'mapping-or-exposed',
5254
hash,
53-
optimizedMappings: config.features.ignoreUnusedDeps,
54-
});
55+
optimizedMappings: config.features.ignoreUnusedDeps,
56+
});
57+
} catch (error) {
58+
logger.error('Error building federation artefacts');
59+
throw error;
60+
}
5561

5662
const resultMap = createBuildResultMap(result, hash);
5763

0 commit comments

Comments
 (0)