Skip to content

Commit

Permalink
feat(start/vite): Use solid-start-bun in bun environment
Browse files Browse the repository at this point in the history
  • Loading branch information
pan93412 committed Sep 12, 2023
1 parent 662278a commit 11d4a9f
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion packages/start/vite/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -632,14 +632,27 @@ const findAny = (path, name, exts = [".js", ".ts", ".jsx", ".tsx", ".mjs", ".mts
return null;
};

const findAdapter = () => {
if (process.env.START_ADAPTER) {
return process.env.START_ADAPTER;
}

// https://bun.sh/guides/util/detect-bun
if (process.versions.bun) {
return "solid-start-bun";
}

return "solid-start-node";
}

/**
* @param {import('./plugin').Options} options
* @returns {import('vite').PluginOption[]}
*/
export default function solidStart(options) {
options = Object.assign(
{
adapter: process.env.START_ADAPTER ? process.env.START_ADAPTER : "solid-start-node",
adapter: findAdapter(),
appRoot: "src",
routesDir: "routes",
ssr:
Expand Down

0 comments on commit 11d4a9f

Please sign in to comment.