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

feat!: add prestart and poststart as adapter options #59

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

devjume
Copy link

@devjume devjume commented Jul 2, 2024

This PR will add prestart and postart as adapter options and pass them them to generated package.json

Example use cases:

  • When using bun:sqlite I want to save sqlite database on it's own folder. With prestart script I can run mkdir ./database/ automatically.
  • with prestart user can run migration scripts before starting production version of sveltekit app.

npm Docs - prestart & poststart

Example how to use:

// svelte.config.js

import adapter from "svelte-adapter-bun";
const config = {
  kit: {
    adapter: adapter({
      prestart: "mkdir ./database",
      poststart: "echo 'poststart'",
    })
  }
};
// generated package.json in build folder

"scripts": {
  "prestart": "mkdir ./database",
  "poststart": "echo 'poststart'",
  "start": "bun ./index.js"
},

@devjume devjume changed the title Add prestart and poststart as adapter options feat!: add prestart and poststart as adapter options Jul 2, 2024
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 this pull request may close these issues.

None yet

1 participant