File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
src/commands/lightning/dev Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 55 * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66 */
77import fs from 'node:fs' ;
8+ import path from 'node:path' ;
89import { SfCommand , Flags } from '@salesforce/sf-plugins-core' ;
910import { Messages } from '@salesforce/core' ;
1011import { expDev } from '@lwrjs/api' ;
@@ -87,7 +88,13 @@ export default class LightningDevSite extends SfCommand<void> {
8788
8889 // For testing purposes, allow skipping startup of the dev server
8990 if ( process . env . SKIP_STARTUP === 'true' ) {
90- this . log ( `Skipping local server startup with parameters: '${ JSON . stringify ( params ) } '` ) ;
91+ this . log ( 'Skipping startup...' ) ;
92+ const scriptToRun = `import { expDev } from '@lwrjs/api';
93+ const params = ${ JSON . stringify ( params , null , 2 ) } ;
94+ await expDev(params);` ;
95+ const pathToScript = path . join ( selectedSite . getSiteDirectory ( ) , 'launchServer.js' ) ;
96+ fs . writeFileSync ( pathToScript , scriptToRun , 'utf-8' ) ;
97+ this . log ( `Launch server from the following script: ${ pathToScript } ` ) ;
9198 } else {
9299 await expDev ( params ) ;
93100 }
You can’t perform that action at this time.
0 commit comments