8
8
import { AngularPreview } from '@bitdev/angular.dev-services.preview.preview' ;
9
9
import {
10
10
AppBuildContext ,
11
+ AppBuildResult ,
11
12
AppContext ,
12
13
Application ,
13
14
ApplicationInstance ,
@@ -28,7 +29,6 @@ import objectHash from 'object-hash';
28
29
import { join } from 'path' ;
29
30
import { readConfigFile , sys } from 'typescript' ;
30
31
import { AngularAppOptions } from './angular-app-options' ;
31
- import { AngularAppBuildResult } from './angular-build-result' ;
32
32
import { buildApplication } from './application.bundler' ;
33
33
import { serveApplication } from './application.dev-server' ;
34
34
import { expandIncludeExclude , JsonObject } from './utils' ;
@@ -103,7 +103,7 @@ export class AngularApp implements Application {
103
103
angularServeOptions,
104
104
angularBuildOptions,
105
105
ngEnvOptions : this . options . ngEnvOptions ,
106
- sourceRoot : this . options . sourceRoot ,
106
+ sourceRoot : this . options . sourceRoot
107
107
} ) ;
108
108
109
109
}
@@ -154,9 +154,9 @@ export class AngularApp implements Application {
154
154
// const vite = await loadEsmModule('vite');
155
155
// const dotenv = vite.loadEnv(mode, rootDir);
156
156
return {
157
- ...overrides ,
157
+ ...overrides
158
158
// ...dotenv
159
- }
159
+ } ;
160
160
}
161
161
162
162
// TODO: fix return type once bit has a new stable version
@@ -208,7 +208,7 @@ export class AngularApp implements Application {
208
208
} ;
209
209
}
210
210
211
- async build ( context : AppBuildContext ) : Promise < AngularAppBuildResult > {
211
+ async build ( context : AppBuildContext ) : Promise < AppBuildResult > {
212
212
const { capsule } = context ;
213
213
const depsResolver = context . getAspect < DependencyResolverMain > ( DependencyResolverAspect . id ) ;
214
214
assert ( depsResolver , 'Dependency resolver is not defined' ) ;
@@ -236,8 +236,8 @@ export class AngularApp implements Application {
236
236
tempFolder : tempFolder ,
237
237
entryServer,
238
238
envVars : {
239
- 'process.env' : envVars
240
- }
239
+ 'process.env' : envVars
240
+ }
241
241
} ) ;
242
242
} else {
243
243
let bundler : Bundler ;
@@ -253,7 +253,14 @@ export class AngularApp implements Application {
253
253
await bundler . run ( ) ;
254
254
}
255
255
return {
256
- publicDir : outputPath
256
+ artifacts : [ {
257
+ name : this . name ,
258
+ globPatterns : [ outputPath ] ,
259
+ } ] ,
260
+ metadata : {
261
+ publicDir : appOptions . ssr ? join ( outputPath , 'browser' ) : outputPath ,
262
+ ssrPublicDir : appOptions . ssr ? join ( outputPath , 'server' ) : undefined
263
+ }
257
264
} ;
258
265
}
259
266
0 commit comments