Skip to content

Commit

Permalink
1.0.87
Browse files Browse the repository at this point in the history
  • Loading branch information
OrJDev committed Nov 19, 2022
1 parent 1845f19 commit 8eccd9c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-jd-app",
"version": "1.0.86",
"version": "1.0.87",
"main": "dist/index.js",
"scripts": {
"test": "ts-node -r tsconfig-paths/register src",
Expand Down
11 changes: 6 additions & 5 deletions src/helpers/vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,21 @@ import { ICtx, IUtil } from "~types";
export const getViteConfig: IUtil = (ctx) => {
const useUno = ctx.installers.includes("UnoCSS");
const shouldUseSSR = !ctx.installers.includes("tRPC");
const plugins = (() => {
const getPlugins = () => {
if (useUno && ctx.vercel) {
return `[
solid({ ssr: ${shouldUseSSR}, adapter: vercel({ edge: false }) }),
UnoCSS(),
]`;
solid({ ssr: ${shouldUseSSR}, adapter: vercel({ edge: false }) }),
UnoCSS(),
]`;
} else if (useUno) {
return `[solid({ ssr: ${shouldUseSSR} }), UnoCSS()]`;
} else if (ctx.vercel) {
return `[solid({ ssr: ${shouldUseSSR}, adapter: vercel({ edge: false }) })]`;
} else {
return `[solid({ ssr: ${shouldUseSSR} })]`;
}
})();
};
const plugins = getPlugins();
return `import solid from "solid-start/vite";
import dotenv from "dotenv";${
useUno ? `\nimport UnoCSS from "unocss/vite";` : ""
Expand Down

0 comments on commit 8eccd9c

Please sign in to comment.