create-lik-app 1.0.3 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. package/dist/index.mjs +35 -35
  2. package/package.json +1 -1
  3. package/templates/template-react/{plugins/index.ts → config/build/_base.ts} +16 -4
  4. package/templates/template-react/config/build/development.ts +7 -0
  5. package/templates/template-react/config/build/production.ts +1 -0
  6. package/templates/template-react/config/build/test.ts +1 -0
  7. package/templates/template-react/src/components/Lic/index.tsx +1 -1
  8. package/templates/{template-react-tanstack-jotai → template-react/src}/types/auto-imports.d.ts +21 -0
  9. package/templates/template-react/src/views/Home/components/React/index.tsx +0 -1
  10. package/templates/template-react/src/views/Home/index.tsx +0 -1
  11. package/templates/template-react/src/views/Layout/index.tsx +0 -1
  12. package/templates/template-react/tsconfig.node.json +1 -6
  13. package/templates/template-react/vite.config.ts +13 -16
  14. package/templates/template-react-tanstack-jotai/{plugins/index.ts → config/build/_base.ts} +19 -7
  15. package/templates/template-react-tanstack-jotai/config/build/development.ts +7 -0
  16. package/templates/template-react-tanstack-jotai/config/build/production.ts +1 -0
  17. package/templates/template-react-tanstack-jotai/config/build/test.ts +1 -0
  18. package/templates/template-react-tanstack-jotai/env/.env.development +1 -0
  19. package/templates/template-react-tanstack-jotai/package.json +10 -9
  20. package/templates/template-react-tanstack-jotai/src/components/Lic/index.tsx +1 -1
  21. package/templates/{template-react → template-react-tanstack-jotai/src}/types/auto-imports.d.ts +4 -18
  22. package/templates/template-react-tanstack-jotai/tsconfig.node.json +1 -6
  23. package/templates/template-react-tanstack-jotai/types/vite-env.d.ts +1 -0
  24. package/templates/template-react-tanstack-jotai/vite.config.ts +13 -16
  25. package/templates/template-vue/config/build/_base.ts +42 -0
  26. package/templates/template-vue/config/build/development.ts +7 -0
  27. package/templates/template-vue/config/build/production.ts +1 -0
  28. package/templates/template-vue/config/build/test.ts +1 -0
  29. package/templates/template-vue/plugins/index.ts +0 -28
  30. package/templates/template-vue/src/types/components.d.ts +21 -0
  31. package/templates/template-vue/tsconfig.node.json +1 -1
  32. package/templates/template-vue/vite.config.ts +13 -14
  33. package/templates/template-vue/types/components.d.ts +0 -21
  34. /package/templates/template-vue/{types → src/types}/auto-imports.d.ts +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-lik-app",
3
- "version": "1.0.3",
3
+ "version": "1.2.3",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "licheung228 <licheung228@163.com>",
@@ -1,9 +1,12 @@
1
+ import { defineConfig } from 'vite'
2
+ import type { Plugin } from 'vite'
1
3
  import react from '@vitejs/plugin-react'
2
4
  import unocss from 'unocss/vite'
3
- import type { PluginOption } from 'vite'
4
5
  import AutoImport from 'unplugin-auto-import/vite'
6
+ import path from 'node:path'
7
+ import process from 'node:process'
5
8
 
6
- export const createPlugins = (): PluginOption[] => [
9
+ const basePlugins: Plugin[] = [
7
10
  react({
8
11
  babel: {
9
12
  plugins: [
@@ -17,8 +20,17 @@ export const createPlugins = (): PluginOption[] => [
17
20
  include: [
18
21
  /\.[tj]sx?$/ // .ts, .tsx, .js, .jsx
19
22
  ],
20
- imports: ['react', 'react-router-dom'],
23
+ imports: ['react', 'react-router-dom', 'mobx', 'mobx-react-lite'],
21
24
  // 为true时在项目根目录自动创建
22
- dts: 'types/auto-imports.d.ts'
25
+ dts: 'src/types/auto-imports.d.ts'
23
26
  })
24
27
  ]
28
+
29
+ export default defineConfig({
30
+ plugins: basePlugins,
31
+ resolve: {
32
+ alias: {
33
+ '@': path.resolve(process.cwd(), 'src')
34
+ }
35
+ }
36
+ })
@@ -0,0 +1,7 @@
1
+ import { defineConfig } from 'vite';
2
+
3
+ export default defineConfig({
4
+ server: {
5
+ port: 8220
6
+ }
7
+ });
@@ -0,0 +1 @@
1
+ export default {};
@@ -0,0 +1 @@
1
+ export default {}
@@ -4,7 +4,7 @@ const Lic: FC<{ favorite: string }> = ({ favorite }) => {
4
4
  return (
5
5
  <div className="animate-keyframes-bounce-in animate-duration-1000 animate-count-1 flex-center flex-col">
6
6
  <img className="w-30" src="/lic.svg" alt="liclogo" />
7
- <p className="text-8xl mt6">{favorite.toUpperCase()}</p>
7
+ <p className="sm:text-8xl text-xl mt6">{favorite.toUpperCase()}</p>
8
8
  </div>
9
9
  )
10
10
  }
@@ -9,14 +9,33 @@ declare global {
9
9
  const Link: typeof import('react-router-dom')['Link']
10
10
  const NavLink: typeof import('react-router-dom')['NavLink']
11
11
  const Navigate: typeof import('react-router-dom')['Navigate']
12
+ const Observer: typeof import('mobx-react-lite')['Observer']
12
13
  const Outlet: typeof import('react-router-dom')['Outlet']
13
14
  const Route: typeof import('react-router-dom')['Route']
14
15
  const Routes: typeof import('react-router-dom')['Routes']
16
+ const action: typeof import('mobx')['action']
17
+ const autorun: typeof import('mobx')['autorun']
18
+ const computed: typeof import('mobx')['computed']
15
19
  const createRef: typeof import('react')['createRef']
20
+ const extendObservable: typeof import('mobx')['extendObservable']
21
+ const flow: typeof import('mobx')['flow']
22
+ const flowResult: typeof import('mobx')['flowResult']
16
23
  const forwardRef: typeof import('react')['forwardRef']
24
+ const intercept: typeof import('mobx')['intercept']
17
25
  const lazy: typeof import('react')['lazy']
26
+ const makeAutoObservable: typeof import('mobx')['makeAutoObservable']
27
+ const makeObservable: typeof import('mobx')['makeObservable']
18
28
  const memo: typeof import('react')['memo']
29
+ const observable: typeof import('mobx')['observable']
30
+ const observe: typeof import('mobx')['observe']
31
+ const observer: typeof import('mobx-react-lite')['observer']
32
+ const onBecomeObserved: typeof import('mobx')['onBecomeObserved']
33
+ const onBecomeUnobserved: typeof import('mobx')['onBecomeUnobserved']
34
+ const onReactionError: typeof import('mobx')['onReactionError']
35
+ const reaction: typeof import('mobx')['reaction']
36
+ const runInAction: typeof import('mobx')['runInAction']
19
37
  const startTransition: typeof import('react')['startTransition']
38
+ const toJS: typeof import('mobx')['toJS']
20
39
  const useCallback: typeof import('react')['useCallback']
21
40
  const useContext: typeof import('react')['useContext']
22
41
  const useDebugValue: typeof import('react')['useDebugValue']
@@ -29,6 +48,7 @@ declare global {
29
48
  const useInsertionEffect: typeof import('react')['useInsertionEffect']
30
49
  const useLayoutEffect: typeof import('react')['useLayoutEffect']
31
50
  const useLinkClickHandler: typeof import('react-router-dom')['useLinkClickHandler']
51
+ const useLocalObservable: typeof import('mobx-react-lite')['useLocalObservable']
32
52
  const useLocation: typeof import('react-router-dom')['useLocation']
33
53
  const useMemo: typeof import('react')['useMemo']
34
54
  const useNavigate: typeof import('react-router-dom')['useNavigate']
@@ -44,4 +64,5 @@ declare global {
44
64
  const useState: typeof import('react')['useState']
45
65
  const useSyncExternalStore: typeof import('react')['useSyncExternalStore']
46
66
  const useTransition: typeof import('react')['useTransition']
67
+ const when: typeof import('mobx')['when']
47
68
  }
@@ -1,4 +1,3 @@
1
- import { observer } from 'mobx-react-lite'
2
1
  import { favoriteStore } from '@/store'
3
2
  import type { FC } from 'react'
4
3
 
@@ -1,4 +1,3 @@
1
- import { observer } from 'mobx-react-lite'
2
1
  import { type FC } from 'react'
3
2
  import Lic from '@/components/Lic'
4
3
  import { favoriteStore } from '@/store'
@@ -1,5 +1,4 @@
1
1
  import { type FC } from 'react'
2
- import { Outlet, Link } from 'react-router-dom'
3
2
 
4
3
  const Layout: FC = () => {
5
4
  return (
@@ -20,10 +20,5 @@
20
20
  "noUnusedParameters": true,
21
21
  "noFallthroughCasesInSwitch": true
22
22
  },
23
- "include": [
24
- "vite.config.ts",
25
- "./config/**/*.ts",
26
- "./plugins/*.ts",
27
- "./types/*.d.ts"
28
- ]
23
+ "include": ["vite.config.ts", "./config/**/*.ts", "./types/*.d.ts"]
29
24
  }
@@ -1,18 +1,15 @@
1
- import { defineConfig } from 'vite'
2
-
3
- import path from 'node:path'
4
- import process from 'node:process'
5
- import { createPlugins } from './plugins'
1
+ import { defineConfig, loadConfigFromFile, mergeConfig } from 'vite'
2
+ import _base from './config/build/_base'
6
3
 
7
4
  // https://vite.dev/config/
8
- export default defineConfig(() => ({
9
- plugins: createPlugins(),
10
- resolve: {
11
- alias: {
12
- '@': path.resolve(process.cwd(), 'src')
13
- }
14
- },
15
- server: {
16
- port: 8220
17
- }
18
- }))
5
+ export default defineConfig(async (configEnv) => {
6
+ if (configEnv.mode === '_base')
7
+ throw new Error('base config is not allowed to be used directly')
8
+
9
+ const re = await loadConfigFromFile(
10
+ configEnv,
11
+ `config/build/${configEnv.mode}.ts`
12
+ )
13
+
14
+ return mergeConfig(_base, re?.config ?? {})
15
+ })
@@ -1,10 +1,13 @@
1
+ import { defineConfig } from 'vite';
2
+ import type { Plugin } from 'vite';
1
3
  import react from '@vitejs/plugin-react';
2
4
  import unocss from 'unocss/vite';
3
- import type { PluginOption } from 'vite';
4
- import AutoImport from 'unplugin-auto-import/vite';
5
5
  import { TanStackRouterVite } from '@tanstack/router-plugin/vite';
6
+ import AutoImport from 'unplugin-auto-import/vite';
7
+ import path from 'node:path';
8
+ import process from 'node:process';
6
9
 
7
- export const createPlugins = (): PluginOption[] => [
10
+ const basePlugins: Plugin[] = [
8
11
  react({
9
12
  babel: {
10
13
  plugins: [
@@ -14,13 +17,22 @@ export const createPlugins = (): PluginOption[] => [
14
17
  }
15
18
  }),
16
19
  unocss(),
20
+ TanStackRouterVite(),
17
21
  AutoImport({
18
22
  include: [
19
23
  /\.[tj]sx?$/ // .ts, .tsx, .js, .jsx
20
24
  ],
21
- imports: ['react', 'react-router-dom'],
25
+ imports: ['react', 'jotai'],
22
26
  // 为true时在项目根目录自动创建
23
- dts: 'types/auto-imports.d.ts'
24
- }),
25
- TanStackRouterVite()
27
+ dts: 'src/types/auto-imports.d.ts'
28
+ })
26
29
  ];
30
+
31
+ export default defineConfig({
32
+ plugins: basePlugins,
33
+ resolve: {
34
+ alias: {
35
+ '@': path.resolve(process.cwd(), 'src')
36
+ }
37
+ }
38
+ });
@@ -0,0 +1,7 @@
1
+ import { defineConfig } from 'vite';
2
+
3
+ export default defineConfig({
4
+ server: {
5
+ port: 8220
6
+ }
7
+ });
@@ -0,0 +1 @@
1
+ export default {};
@@ -1 +1,2 @@
1
1
  VITE_APP_DOMAIN="https://api.example.com"
2
+ VITE_APP_SSL=""
@@ -5,21 +5,22 @@
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
8
+ "dev:test": "vite --mode test",
8
9
  "build": "tsc -b && vite build",
9
- "lint": "eslint .",
10
10
  "preview": "vite preview",
11
+ "lint": "eslint .",
11
12
  "preinstall": "npx only-allow pnpm",
12
13
  "prepare": "husky"
13
14
  },
14
15
  "dependencies": {
15
16
  "@gsap/react": "^2.1.1",
16
- "@tanstack/react-router": "^1.92.3",
17
+ "@tanstack/react-router": "^1.92.6",
17
18
  "@unocss/reset": "^0.64.1",
18
19
  "gsap": "^3.12.5",
19
20
  "jotai": "^2.11.0",
20
21
  "rainbow-print": "0.0.1-alpha.2",
21
- "react": "^18.3.1",
22
- "react-dom": "^18.3.1"
22
+ "react": "^19.0.0",
23
+ "react-dom": "^19.0.0"
23
24
  },
24
25
  "devDependencies": {
25
26
  "@babel/plugin-proposal-decorators": "^7.25.9",
@@ -29,10 +30,10 @@
29
30
  "@tanstack/router-devtools": "^1.92.3",
30
31
  "@tanstack/router-plugin": "^1.91.1",
31
32
  "@types/node": "^22.9.1",
32
- "@types/react": "^18.3.12",
33
- "@types/react-dom": "^18.3.1",
33
+ "@types/react": "^19.0.2",
34
+ "@types/react-dom": "^19.0.2",
34
35
  "@typescript-eslint/eslint-plugin": "^8.15.0",
35
- "@vitejs/plugin-react": "^4.3.3",
36
+ "@vitejs/plugin-react": "^4.3.4",
36
37
  "eslint": "^9.14.0",
37
38
  "eslint-config-prettier": "^9.1.0",
38
39
  "eslint-plugin-prettier": "^5.2.1",
@@ -44,8 +45,8 @@
44
45
  "only-allow": "^1.2.1",
45
46
  "typescript": "~5.6.2",
46
47
  "typescript-eslint": "^8.13.0",
47
- "unocss": "^0.64.0",
48
+ "unocss": "^0.65.3",
48
49
  "unplugin-auto-import": "^0.18.6",
49
- "vite": "^5.4.10"
50
+ "vite": "^6.0.6"
50
51
  }
51
52
  }
@@ -4,7 +4,7 @@ const Lic: FC<{ favorite: string }> = ({ favorite }) => {
4
4
  return (
5
5
  <div className="animate-keyframes-bounce-in animate-duration-1000 animate-count-1 flex-center flex-col">
6
6
  <img className="w-30" src="/lic.svg" alt="liclogo" />
7
- <p className="text-8xl mt6">{favorite.toUpperCase()}</p>
7
+ <p className="sm:text-8xl text-xl mt6">{favorite.toUpperCase()}</p>
8
8
  </div>
9
9
  );
10
10
  };
@@ -6,41 +6,27 @@
6
6
  // biome-ignore lint: disable
7
7
  export {}
8
8
  declare global {
9
- const Link: typeof import('react-router-dom')['Link']
10
- const NavLink: typeof import('react-router-dom')['NavLink']
11
- const Navigate: typeof import('react-router-dom')['Navigate']
12
- const Outlet: typeof import('react-router-dom')['Outlet']
13
- const Route: typeof import('react-router-dom')['Route']
14
- const Routes: typeof import('react-router-dom')['Routes']
9
+ const atom: typeof import('jotai')['atom']
15
10
  const createRef: typeof import('react')['createRef']
16
11
  const forwardRef: typeof import('react')['forwardRef']
17
12
  const lazy: typeof import('react')['lazy']
18
13
  const memo: typeof import('react')['memo']
19
14
  const startTransition: typeof import('react')['startTransition']
15
+ const useAtom: typeof import('jotai')['useAtom']
16
+ const useAtomValue: typeof import('jotai')['useAtomValue']
20
17
  const useCallback: typeof import('react')['useCallback']
21
18
  const useContext: typeof import('react')['useContext']
22
19
  const useDebugValue: typeof import('react')['useDebugValue']
23
20
  const useDeferredValue: typeof import('react')['useDeferredValue']
24
21
  const useEffect: typeof import('react')['useEffect']
25
- const useHref: typeof import('react-router-dom')['useHref']
26
22
  const useId: typeof import('react')['useId']
27
23
  const useImperativeHandle: typeof import('react')['useImperativeHandle']
28
- const useInRouterContext: typeof import('react-router-dom')['useInRouterContext']
29
24
  const useInsertionEffect: typeof import('react')['useInsertionEffect']
30
25
  const useLayoutEffect: typeof import('react')['useLayoutEffect']
31
- const useLinkClickHandler: typeof import('react-router-dom')['useLinkClickHandler']
32
- const useLocation: typeof import('react-router-dom')['useLocation']
33
26
  const useMemo: typeof import('react')['useMemo']
34
- const useNavigate: typeof import('react-router-dom')['useNavigate']
35
- const useNavigationType: typeof import('react-router-dom')['useNavigationType']
36
- const useOutlet: typeof import('react-router-dom')['useOutlet']
37
- const useOutletContext: typeof import('react-router-dom')['useOutletContext']
38
- const useParams: typeof import('react-router-dom')['useParams']
39
27
  const useReducer: typeof import('react')['useReducer']
40
28
  const useRef: typeof import('react')['useRef']
41
- const useResolvedPath: typeof import('react-router-dom')['useResolvedPath']
42
- const useRoutes: typeof import('react-router-dom')['useRoutes']
43
- const useSearchParams: typeof import('react-router-dom')['useSearchParams']
29
+ const useSetAtom: typeof import('jotai')['useSetAtom']
44
30
  const useState: typeof import('react')['useState']
45
31
  const useSyncExternalStore: typeof import('react')['useSyncExternalStore']
46
32
  const useTransition: typeof import('react')['useTransition']
@@ -20,10 +20,5 @@
20
20
  "noUnusedParameters": true,
21
21
  "noFallthroughCasesInSwitch": true
22
22
  },
23
- "include": [
24
- "vite.config.ts",
25
- "./config/**/*.ts",
26
- "./plugins/*.ts",
27
- "./types/*.d.ts"
28
- ]
23
+ "include": ["vite.config.ts", "./config/**/*.ts", "./types/*.d.ts"]
29
24
  }
@@ -2,6 +2,7 @@
2
2
 
3
3
  interface ImportMetaEnv {
4
4
  VITE_APP_DOMAIN: string;
5
+ VITE_APP_SSL: string;
5
6
  }
6
7
 
7
8
  interface ImportMeta {
@@ -1,18 +1,15 @@
1
- import { defineConfig } from 'vite';
2
-
3
- import path from 'node:path';
4
- import process from 'node:process';
5
- import { createPlugins } from './plugins';
1
+ import { defineConfig, loadConfigFromFile, mergeConfig } from 'vite';
2
+ import _base from './config/build/_base';
6
3
 
7
4
  // https://vite.dev/config/
8
- export default defineConfig(() => ({
9
- plugins: createPlugins(),
10
- resolve: {
11
- alias: {
12
- '@': path.resolve(process.cwd(), 'src')
13
- }
14
- },
15
- server: {
16
- port: 8220
17
- }
18
- }));
5
+ export default defineConfig(async (configEnv) => {
6
+ if (configEnv.mode === '_base')
7
+ throw new Error('base config is not allowed to be used directly');
8
+
9
+ const re = await loadConfigFromFile(
10
+ configEnv,
11
+ `config/build/${configEnv.mode}.ts`
12
+ );
13
+
14
+ return mergeConfig(_base, re?.config ?? {});
15
+ });
@@ -0,0 +1,42 @@
1
+ import { defineConfig } from 'vite'
2
+ import type { Plugin } from 'vite'
3
+ import path from 'node:path'
4
+ import process from 'node:process'
5
+ import vue from '@vitejs/plugin-vue'
6
+ import vueJsx from '@vitejs/plugin-vue-jsx'
7
+ import vueDevTools from 'vite-plugin-vue-devtools'
8
+ import AutoImport from 'unplugin-auto-import/vite'
9
+ import Components from 'unplugin-vue-components/vite'
10
+
11
+ const basePlugins: Plugin[] = [
12
+ vue(),
13
+ vueJsx(),
14
+ vueDevTools(),
15
+ AutoImport({
16
+ include: [
17
+ /\.vue$/,
18
+ /\.vue\?vue/, // .vue
19
+ ],
20
+ imports: ['vue', 'vue-router', 'pinia', '@vueuse/core'],
21
+ // 为true时在项目根目录自动创建
22
+ dts: 'src/types/auto-imports.d.ts',
23
+ }),
24
+ // 按需加载组件
25
+ Components({
26
+ // 自动加载的组件目录,默认值为 ['src/components']
27
+ dirs: ['src/components'],
28
+ // 组件名称包含目录,防止同名组件冲突
29
+ directoryAsNamespace: true,
30
+ // 指定类型声明文件,为true时在项目根目录创建
31
+ dts: 'src/types/components.d.ts',
32
+ }),
33
+ ]
34
+
35
+ export default defineConfig({
36
+ plugins: basePlugins,
37
+ resolve: {
38
+ alias: {
39
+ '@': path.resolve(process.cwd(), 'src'),
40
+ },
41
+ },
42
+ })
@@ -0,0 +1,7 @@
1
+ import { defineConfig } from 'vite';
2
+
3
+ export default defineConfig({
4
+ server: {
5
+ port: 8220
6
+ }
7
+ });
@@ -0,0 +1 @@
1
+ export default {};
@@ -0,0 +1 @@
1
+ export default {};
@@ -1,28 +0,0 @@
1
- import vue from '@vitejs/plugin-vue'
2
- import vueJsx from '@vitejs/plugin-vue-jsx'
3
- import vueDevTools from 'vite-plugin-vue-devtools'
4
- import AutoImport from 'unplugin-auto-import/vite'
5
- import Components from 'unplugin-vue-components/vite'
6
- export const createPlugins = () => [
7
- vue(),
8
- vueJsx(),
9
- vueDevTools(),
10
- AutoImport({
11
- include: [
12
- /\.vue$/,
13
- /\.vue\?vue/, // .vue
14
- ],
15
- imports: ['vue', 'vue-router', 'pinia', '@vueuse/core'],
16
- // 为true时在项目根目录自动创建
17
- dts: 'types/auto-imports.d.ts',
18
- }),
19
- // 按需加载组件
20
- Components({
21
- // 自动加载的组件目录,默认值为 ['src/components']
22
- dirs: ['src/components'],
23
- // 组件名称包含目录,防止同名组件冲突
24
- directoryAsNamespace: true,
25
- // 指定类型声明文件,为true时在项目根目录创建
26
- dts: 'types/components.d.ts',
27
- }),
28
- ]
@@ -0,0 +1,21 @@
1
+ /* eslint-disable */
2
+ // @ts-nocheck
3
+ // Generated by unplugin-vue-components
4
+ // Read more: https://github.com/vuejs/core/pull/3399
5
+ export {}
6
+
7
+ /* prettier-ignore */
8
+ declare module 'vue' {
9
+ export interface GlobalComponents {
10
+ HelloWorld: typeof import('./../components/HelloWorld.vue')['default']
11
+ IconsIconCommunity: typeof import('./../components/icons/IconCommunity.vue')['default']
12
+ IconsIconDocumentation: typeof import('./../components/icons/IconDocumentation.vue')['default']
13
+ IconsIconEcosystem: typeof import('./../components/icons/IconEcosystem.vue')['default']
14
+ IconsIconSupport: typeof import('./../components/icons/IconSupport.vue')['default']
15
+ IconsIconTooling: typeof import('./../components/icons/IconTooling.vue')['default']
16
+ RouterLink: typeof import('vue-router')['RouterLink']
17
+ RouterView: typeof import('vue-router')['RouterView']
18
+ TheWelcome: typeof import('./../components/TheWelcome.vue')['default']
19
+ WelcomeItem: typeof import('./../components/WelcomeItem.vue')['default']
20
+ }
21
+ }
@@ -6,7 +6,7 @@
6
6
  "cypress.config.*",
7
7
  "nightwatch.conf.*",
8
8
  "playwright.config.*",
9
- "plugins/*"
9
+ "config/**/*.ts"
10
10
  ],
11
11
  "compilerOptions": {
12
12
  "composite": true,
@@ -1,16 +1,15 @@
1
- import { fileURLToPath, URL } from 'node:url'
2
- import { defineConfig } from 'vite'
3
- import { createPlugins } from './plugins'
1
+ import { defineConfig, loadConfigFromFile, mergeConfig } from 'vite'
2
+ import _base from './config/build/_base'
4
3
 
5
- export default defineConfig({
6
- envDir: './env',
7
- plugins: createPlugins(),
8
- resolve: {
9
- alias: {
10
- '@': fileURLToPath(new URL('./src', import.meta.url)),
11
- },
12
- },
13
- server: {
14
- port: 8220,
15
- },
4
+ // https://vite.dev/config/
5
+ export default defineConfig(async (configEnv) => {
6
+ if (configEnv.mode === '_base')
7
+ throw new Error('base config is not allowed to be used directly')
8
+
9
+ const re = await loadConfigFromFile(
10
+ configEnv,
11
+ `config/build/${configEnv.mode}.ts`,
12
+ )
13
+
14
+ return mergeConfig(_base, re?.config ?? {})
16
15
  })
@@ -1,21 +0,0 @@
1
- /* eslint-disable */
2
- // @ts-nocheck
3
- // Generated by unplugin-vue-components
4
- // Read more: https://github.com/vuejs/core/pull/3399
5
- export {}
6
-
7
- /* prettier-ignore */
8
- declare module 'vue' {
9
- export interface GlobalComponents {
10
- HelloWorld: typeof import('./../src/components/HelloWorld.vue')['default']
11
- IconsIconCommunity: typeof import('./../src/components/icons/IconCommunity.vue')['default']
12
- IconsIconDocumentation: typeof import('./../src/components/icons/IconDocumentation.vue')['default']
13
- IconsIconEcosystem: typeof import('./../src/components/icons/IconEcosystem.vue')['default']
14
- IconsIconSupport: typeof import('./../src/components/icons/IconSupport.vue')['default']
15
- IconsIconTooling: typeof import('./../src/components/icons/IconTooling.vue')['default']
16
- RouterLink: typeof import('vue-router')['RouterLink']
17
- RouterView: typeof import('vue-router')['RouterView']
18
- TheWelcome: typeof import('./../src/components/TheWelcome.vue')['default']
19
- WelcomeItem: typeof import('./../src/components/WelcomeItem.vue')['default']
20
- }
21
- }