Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package manager agnostic Tauri build scripts #23

Open
carlos-menezes opened this issue Nov 14, 2023 · 0 comments
Open

Package manager agnostic Tauri build scripts #23

carlos-menezes opened this issue Nov 14, 2023 · 0 comments

Comments

@carlos-menezes
Copy link

Currently, Tauri's build scripts are not package-manager agnostic

"build": {
    "beforeDevCommand": "yarn dev",
    "beforeBuildCommand": "yarn build",
    "devPath": "http://localhost:1420",
    "distDir": "../dist",
    "withGlobalTauri": false
  }

There's one easy way to accomplish this, with the only downside being that the npm command will run if the yarn command fails (e.g. the build fails).

    "beforeDevCommand": "yarn dev || npm run dev",
    "beforeBuildCommand": "yarn build || npm run build",

Alternatively, we could substitute the yarn command by node $npm_execpath run <script> (on Unix systems) or node \"%npm_execpath%\" run <script> (on Windows). The only downside to this approach is that you would need dev.unix and dev.win: essentially, repeat every script twice.

Or just support yarn. What are your thoughts?

@carlos-menezes carlos-menezes changed the title Package agnostic Tauri build scripts Package manager agnostic Tauri build scripts Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant