1- import path from 'path' ;
21import 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' ;
74import { ExposesInfo , SharedInfo } from '@softarc/native-federation-runtime' ;
5+ import { NormalizedFederationConfig } from '../config/federation-config' ;
86import {
97 createBuildResultMap ,
108 lookupInResultMap ,
119} from '../utils/build-result-map' ;
10+ import { bundle } from '../utils/build-utils' ;
1211import { logger } from '../utils/logger' ;
1312import { normalize } from '../utils/normalize' ;
13+ import { FederationOptions } from './federation-options' ;
1414
1515export 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