feat(cli): Pass package manager setting to dev server.

This commit is contained in:
Gervwyk 2022-01-23 22:05:42 +02:00
parent db2338dc34
commit 0425f07e4a
2 changed files with 3 additions and 2 deletions

View File

@ -26,6 +26,7 @@ async function runDevServer({ context }) {
cwd: context.directories.devServer,
env: {
...process.env,
LOWDEFY_PACKAGE_MANAGER: context.packageManager,
LOWDEFY_DIRECTORY_CONFIG: context.directories.config,
PORT: context.options.port,
},

View File

@ -32,7 +32,7 @@ import startWatchers from './processes/startWatchers.mjs';
const argv = yargs(hideBin(process.argv)).argv;
async function getContext() {
const { packageManager = 'npm', verbose = false } = argv;
const { verbose = false } = argv;
const context = {
directories: {
build: path.resolve(process.cwd(), './build'),
@ -41,7 +41,7 @@ async function getContext() {
),
server: process.cwd(),
},
packageManager,
packageManager: argv.packageManager || process.env.LOWDEFY_PACKAGE_MANAGER || 'npm',
port: argv.port || process.env.PORT || 3000,
verbose,
version: process.env.npm_package_version,