fix(cta): use correct beforeDevCommand for vite recipe (#1931)

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
This commit is contained in:
Amr Bashir
2021-06-01 00:37:16 +02:00
committed by GitHub
parent 1341ca9a1b
commit 3c21ddc73c
3 changed files with 8 additions and 3 deletions

View File

@@ -0,0 +1,5 @@
---
"create-tauri-app": patch
---
Fixes the `beforeDevCommand` on vite recipe.

View File

@@ -339,7 +339,7 @@ const runInit = async (argv: Argv): Promise<void> => {
packageManager
})
logStep('Adding `tauri` script to package.json')
logStep(`Adding ${reset(yellow('"tauri"'))} script to package.json`)
addTauriScript(appDirectory)
logStep(`Running: ${reset(yellow('tauri init'))}`)
@@ -352,7 +352,7 @@ const runInit = async (argv: Argv): Promise<void> => {
cwd: appDirectory
})
logStep('Updating `tauri.conf.json`')
logStep(`Updating ${reset(yellow('"tauri.conf.json"'))}`)
updateTauriConf(appDirectory, cfg)
}

View File

@@ -34,7 +34,7 @@ const vite: Recipe = {
...cfg,
distDir: `../dist`,
devPath: 'http://localhost:3000',
beforeDevCommand: `${packageManager === 'yarn' ? 'yarn' : 'npm run'} start`,
beforeDevCommand: `${packageManager === 'yarn' ? 'yarn' : 'npm run'} dev`,
beforeBuildCommand: `${
packageManager === 'yarn' ? 'yarn' : 'npm run'
} build`