create-kyro 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-kyro",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Interactive scaffolding for Kyro CMS projects",
5
5
  "type": "module",
6
6
  "bin": {
@@ -3,6 +3,7 @@ import type { Answers } from "../prompts.js";
3
3
  export function generateAstroConfig(answers: Answers): string {
4
4
  const integrations: string[] = [];
5
5
  const vitePlugins: string[] = [];
6
+ const vitePluginsLength = vitePlugins.length;
6
7
 
7
8
  if (answers.styling === "tailwind") {
8
9
  integrations.push(" react(),");
@@ -18,6 +19,7 @@ export function generateAstroConfig(answers: Answers): string {
18
19
 
19
20
  const config = `import { defineConfig } from 'astro/config';
20
21
  import node from '@astrojs/node';
22
+ import path from 'path';
21
23
  ${answers.styling === "tailwind" ? "import react from '@astrojs/react';\nimport tailwindcss from '@tailwindcss/vite';" : ""}
22
24
 
23
25
  export default defineConfig({
@@ -26,12 +28,21 @@ export default defineConfig({
26
28
  integrations: [
27
29
  ${integrations.join("\n")}
28
30
  ],${
29
- vitePlugins.length > 0
31
+ vitePlugins.length > 0 || answers.admin
30
32
  ? `
31
33
  vite: {
34
+ resolve: {
35
+ alias: {
36
+ '@': path.resolve('./src'),
37
+ },
38
+ },${
39
+ vitePluginsLength > 0
40
+ ? `
32
41
  plugins: [
33
42
  ${vitePlugins.join("\n")}
34
- ],
43
+ ],`
44
+ : ""
45
+ }
35
46
  },`
36
47
  : ""
37
48
  }