@@ -13,6 +13,7 @@ import copyfiles from 'cpy'
13
13
import debounce from 'debounce'
14
14
import tsStatic from 'typescript'
15
15
import { join , relative } from 'path'
16
+ import { Colors } from '@poppinss/colors'
16
17
import { Logger } from '@poppinss/fancy-logs'
17
18
import { remove , outputJSON } from 'fs-extra'
18
19
import { resolveFrom } from '@poppinss/utils'
@@ -21,7 +22,6 @@ import { iocTransformer } from '@adonisjs/ioc-transformer'
21
22
22
23
import { RcFile } from '../RcFile'
23
24
import { Manifest } from '../Manifest'
24
- import { Installer } from '../Installer'
25
25
import { HttpServer , DummyHttpServer } from '../HttpServer'
26
26
import {
27
27
RCFILE_NAME ,
@@ -70,6 +70,8 @@ export class Compiler {
70
70
*/
71
71
private getRelativeUnixPath = mem ( ( absPath : string ) => slash ( relative ( this . appRoot , absPath ) ) )
72
72
73
+ private colors = new Colors ( )
74
+
73
75
constructor (
74
76
public appRoot : string ,
75
77
private serveApp : boolean ,
@@ -244,22 +246,18 @@ export class Compiler {
244
246
await this . copyMetaFiles ( config . options . outDir ! , pkgFiles )
245
247
this . buildTypescriptSource ( config )
246
248
await this . copyAdonisRcFile ( config . options . outDir ! )
249
+ await this . manifest . generate ( )
247
250
248
- this . logger . info ( { message : 'installing production dependencies' , suffix : client } )
249
- await new Installer ( config . options . outDir ! , client ) . install ( )
251
+ const installCommand = client === 'npm'
252
+ ? 'npm ci --production'
253
+ : 'yarn install --production'
250
254
251
- /**
252
- * Manifest can be generated without blocking the flow
253
- */
254
- this . manifest . generate ( )
255
+ console . log ( ' Run the following commands to start the server in production' )
256
+ const relativeBuildPath = this . getRelativeUnixPath ( config . options . outDir ! )
255
257
256
- /**
257
- * Start HTTP server in production
258
- */
259
- if ( this . serveApp ) {
260
- this . createHttpServer ( config . options . outDir ! )
261
- this . httpServer . start ( )
262
- }
258
+ console . log ( ` ${ this . colors . gray ( '$' ) } ${ this . colors . cyan ( `cd ${ relativeBuildPath } ` ) } ` )
259
+ console . log ( ` ${ this . colors . gray ( '$' ) } ${ this . colors . cyan ( installCommand ) } ` )
260
+ console . log ( ` ${ this . colors . gray ( '$' ) } ${ this . colors . cyan ( 'node server.js' ) } ` )
263
261
264
262
return true
265
263
}
0 commit comments