Search code examples
npmgithub-pagespackage.jsonbun

How to deploy a Static website project with bun.lockb to Github Pages?


I have a vite-react static page project, where I have exclusively used bun to install packages and for building the project.That's the reason it does not have package-json.lock instead it has bun.lockb.

Now I am trying to deploy this project into Github pages. I am using the template yml provided by Vite official documentation.

This is the error I see in the GitHub deployment log. I understand that this is because my project does not have package-json.lock.

Github Deployment error

Error: Dependencies lock file is not found in /home/runner/work/rolling/rolling. Supported file patterns: package-lock.json,npm-shrinkwrap.json,yarn.lock

Can I configure the deployment anywhere in Github, for it to understand that it has to look at bun.lockb instead of package-json.lock?

If this is not possible, the only other way to solve it would be to just use both npm and bun in the project so that npm generates the package-json.lock file. or is there a better way to do it?


Solution

  • Thanks to phil. I figured out how to use Github Pages with bun. These are the changes that the project needed.

    Below are the changes I made. Left part of image is the yml from vite documentation, right is the changes I made for bun.

    Changes I made Changes I madee