gornostay25 / svelte-adapter-bun

A SvelteKit adapter for Bun
MIT License
534 stars 33 forks source link

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

Open devjume opened 4 months ago

devjume commented 4 months ago

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

Example use cases:

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"
},