1
- import path from 'path' ;
2
1
import fs from 'fs' ;
2
+ import path from 'path' ;
3
3
4
- import { NormalizedFederationConfig } from '../config/federation-config' ;
5
- import { FederationOptions } from './federation-options' ;
6
- import { bundle } from '../utils/build-utils' ;
7
4
import { ExposesInfo , SharedInfo } from '@softarc/native-federation-runtime' ;
5
+ import { NormalizedFederationConfig } from '../config/federation-config' ;
8
6
import {
9
7
createBuildResultMap ,
10
8
lookupInResultMap ,
11
9
} from '../utils/build-result-map' ;
10
+ import { bundle } from '../utils/build-utils' ;
12
11
import { logger } from '../utils/logger' ;
13
12
import { normalize } from '../utils/normalize' ;
13
+ import { FederationOptions } from './federation-options' ;
14
14
15
15
export interface ArtefactInfo {
16
16
mappings : SharedInfo [ ] ;
@@ -40,7 +40,9 @@ export async function bundleExposedAndMappings(
40
40
41
41
logger . info ( 'Building federation artefacts' ) ;
42
42
43
- const result = await bundle ( {
43
+ let result ;
44
+ try {
45
+ result = await bundle ( {
44
46
entryPoints,
45
47
outdir : fedOptions . outputPath ,
46
48
tsConfigPath : fedOptions . tsConfig ,
@@ -50,8 +52,12 @@ export async function bundleExposedAndMappings(
50
52
mappedPaths : config . sharedMappings ,
51
53
kind : 'mapping-or-exposed' ,
52
54
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
+ }
55
61
56
62
const resultMap = createBuildResultMap ( result , hash ) ;
57
63
0 commit comments