Skip to content

Commit 941da90

Browse files
chore: include comments
1 parent 0d9aa9a commit 941da90

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/serve/index.ts

+9
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@ const pmConfig: PackageManagerConfig = {
4646
};
4747

4848
const spawnWithArg = (pm: string, cmd: string): SpawnSyncReturns<Buffer> => {
49+
/*
50+
* The dependency installation commands for the
51+
* respective package manager is available as
52+
* nested objects within pmConfig
53+
*
54+
* We gonna extract the root installation command
55+
* and rest of the flags from pmConfig object
56+
* by means of array destructuring
57+
*/
4958
const [installCmd, ...flags] = pmConfig[pm][cmd];
5059
const options: string[] = [installCmd, "webpack-dev-server", ...flags];
5160
return spawn.sync(pm, options, { stdio: "inherit" });

0 commit comments

Comments
 (0)