File tree Expand file tree Collapse file tree 5 files changed +98
-1
lines changed
packages/web/src/builders/file-server Expand file tree Collapse file tree 5 files changed +98
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,20 @@ Type: `string`
2020
2121Host to listen on.
2222
23+ ### maxParallel
24+
25+ Type: ` number `
26+
27+ Max number of parallel jobs
28+
29+ ### parallel
30+
31+ Default: ` true `
32+
33+ Type: ` boolean `
34+
35+ Build the target in parallel
36+
2337### port
2438
2539Default: ` 4200 `
@@ -53,3 +67,11 @@ SSL certificate to use for serving HTTPS.
5367Type: ` string `
5468
5569SSL key to use for serving HTTPS.
70+
71+ ### withDeps
72+
73+ Default: ` true `
74+
75+ Type: ` boolean `
76+
77+ Build the target and all its deps
Original file line number Diff line number Diff line change @@ -21,6 +21,20 @@ Type: `string`
2121
2222Host to listen on.
2323
24+ ### maxParallel
25+
26+ Type: ` number `
27+
28+ Max number of parallel jobs
29+
30+ ### parallel
31+
32+ Default: ` true `
33+
34+ Type: ` boolean `
35+
36+ Build the target in parallel
37+
2438### port
2539
2640Default: ` 4200 `
@@ -54,3 +68,11 @@ SSL certificate to use for serving HTTPS.
5468Type: ` string `
5569
5670SSL key to use for serving HTTPS.
71+
72+ ### withDeps
73+
74+ Default: ` true `
75+
76+ Type: ` boolean `
77+
78+ Build the target and all its deps
Original file line number Diff line number Diff line change @@ -21,6 +21,20 @@ Type: `string`
2121
2222Host to listen on.
2323
24+ ### maxParallel
25+
26+ Type: ` number `
27+
28+ Max number of parallel jobs
29+
30+ ### parallel
31+
32+ Default: ` true `
33+
34+ Type: ` boolean `
35+
36+ Build the target in parallel
37+
2438### port
2539
2640Default: ` 4200 `
@@ -54,3 +68,11 @@ SSL certificate to use for serving HTTPS.
5468Type: ` string `
5569
5670SSL key to use for serving HTTPS.
71+
72+ ### withDeps
73+
74+ Default: ` true `
75+
76+ Type: ` boolean `
77+
78+ Build the target and all its deps
Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ export interface FileServerOptions extends JsonObject {
1313 sslCert ?: string ;
1414 proxyUrl ?: string ;
1515 buildTarget : string ;
16+ parallel : boolean ;
17+ maxParalel : number ;
18+ withDeps : boolean ;
1619}
1720
1821function getHttpServerArgs ( opts : FileServerOptions ) {
@@ -38,6 +41,20 @@ function getHttpServerArgs(opts: FileServerOptions) {
3841 return args ;
3942}
4043
44+ function getBuildTargetCommand ( opts : FileServerOptions ) {
45+ const cmd = [ `npx nx run ${ opts . buildTarget } ` ] ;
46+ if ( opts . withDeps ) {
47+ cmd . push ( `--with-deps` ) ;
48+ }
49+ if ( opts . parallel ) {
50+ cmd . push ( `--parallel` ) ;
51+ }
52+ if ( opts . maxParalel ) {
53+ cmd . push ( `--maxParallel=${ opts . maxParalel } ` ) ;
54+ }
55+ return cmd . join ( ' ' ) ;
56+ }
57+
4158function getBuildTargetOutputPath (
4259 opts : FileServerOptions ,
4360 context : TargetContext
@@ -99,7 +116,7 @@ export default async function (
99116 changed = false ;
100117 running = true ;
101118 try {
102- execSync ( `npx nx run ${ opts . buildTarget } --with-deps` , {
119+ execSync ( getBuildTargetCommand ( opts ) , {
103120 stdio : [ 0 , 1 , 2 ] ,
104121 } ) ;
105122 } catch ( e ) { }
Original file line number Diff line number Diff line change 88 "type" : " string" ,
99 "description" : " Target which builds the application"
1010 },
11+ "withDeps" : {
12+ "type" : " boolean" ,
13+ "description" : " Build the target and all its deps" ,
14+ "default" : true
15+ },
16+ "parallel" : {
17+ "type" : " boolean" ,
18+ "description" : " Build the target in parallel" ,
19+ "default" : true
20+ },
21+ "maxParallel" : {
22+ "type" : " number" ,
23+ "description" : " Max number of parallel jobs"
24+ },
1125 "port" : {
1226 "type" : " number" ,
1327 "description" : " Port to listen on." ,
You can’t perform that action at this time.
0 commit comments