88import { AngularPreview } from '@bitdev/angular.dev-services.preview.preview' ;
99import {
1010 AppBuildContext ,
11+ AppBuildResult ,
1112 AppContext ,
1213 Application ,
1314 ApplicationInstance ,
@@ -28,7 +29,6 @@ import objectHash from 'object-hash';
2829import { join } from 'path' ;
2930import { readConfigFile , sys } from 'typescript' ;
3031import { AngularAppOptions } from './angular-app-options' ;
31- import { AngularAppBuildResult } from './angular-build-result' ;
3232import { buildApplication } from './application.bundler' ;
3333import { serveApplication } from './application.dev-server' ;
3434import { expandIncludeExclude , JsonObject } from './utils' ;
@@ -103,7 +103,7 @@ export class AngularApp implements Application {
103103 angularServeOptions,
104104 angularBuildOptions,
105105 ngEnvOptions : this . options . ngEnvOptions ,
106- sourceRoot : this . options . sourceRoot ,
106+ sourceRoot : this . options . sourceRoot
107107 } ) ;
108108
109109 }
@@ -154,9 +154,9 @@ export class AngularApp implements Application {
154154 // const vite = await loadEsmModule('vite');
155155 // const dotenv = vite.loadEnv(mode, rootDir);
156156 return {
157- ...overrides ,
157+ ...overrides
158158 // ...dotenv
159- }
159+ } ;
160160 }
161161
162162 // TODO: fix return type once bit has a new stable version
@@ -208,7 +208,7 @@ export class AngularApp implements Application {
208208 } ;
209209 }
210210
211- async build ( context : AppBuildContext ) : Promise < AngularAppBuildResult > {
211+ async build ( context : AppBuildContext ) : Promise < AppBuildResult > {
212212 const { capsule } = context ;
213213 const depsResolver = context . getAspect < DependencyResolverMain > ( DependencyResolverAspect . id ) ;
214214 assert ( depsResolver , 'Dependency resolver is not defined' ) ;
@@ -236,8 +236,8 @@ export class AngularApp implements Application {
236236 tempFolder : tempFolder ,
237237 entryServer,
238238 envVars : {
239- 'process.env' : envVars
240- }
239+ 'process.env' : envVars
240+ }
241241 } ) ;
242242 } else {
243243 let bundler : Bundler ;
@@ -253,7 +253,14 @@ export class AngularApp implements Application {
253253 await bundler . run ( ) ;
254254 }
255255 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+ }
257264 } ;
258265 }
259266
0 commit comments