File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
src/commands/lightning/dev Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 77import fs from 'node:fs' ;
88import { SfCommand , Flags } from '@salesforce/sf-plugins-core' ;
99import { Messages } from '@salesforce/core' ;
10- import { expDev } from '@lwrjs/api' ;
10+ import { expDev , setupDev } from '@lwrjs/api' ;
1111import { OrgUtils } from '../../../shared/orgUtils.js' ;
1212import { PromptUtils } from '../../../shared/promptUtils.js' ;
1313import { ExperienceSite } from '../../../shared/experience/expSite.js' ;
@@ -79,15 +79,24 @@ export default class LightningDevSite extends SfCommand<void> {
7979 const authToken = await selectedSite . setupAuth ( ) ;
8080
8181 // Start the dev server
82- await expDev ( {
82+ const port = parseInt ( process . env . PORT ?? '3000' , 10 ) ;
83+ const startupParams = {
84+ sfCli : true ,
8385 authToken,
8486 open : true ,
85- port : 3000 ,
87+ port,
8688 logLevel : 'error' ,
8789 mode : 'dev' ,
8890 siteZip,
8991 siteDir : selectedSite . getSiteDirectory ( ) ,
90- } ) ;
92+ } ;
93+
94+ // Environment variable used to setup the site rather than setup & start server
95+ if ( process . env . SETUP_ONLY === 'true' ) {
96+ await setupDev ( startupParams ) ;
97+ } else {
98+ await expDev ( startupParams ) ;
99+ }
91100 } catch ( e ) {
92101 this . log ( 'Local Development setup failed' , e ) ;
93102 }
You can’t perform that action at this time.
0 commit comments