@tomjs/create-app 5.1.0 → 5.3.0

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.
Files changed (44) hide show
  1. package/README.md +4 -0
  2. package/README.zh_CN.md +4 -0
  3. package/package.json +8 -8
  4. package/templates/config/base/package.json +3 -0
  5. package/templates/config/electron/package.json +2 -2
  6. package/templates/config/hbuilderx/package.json +1 -1
  7. package/templates/config/package.json +23 -15
  8. package/templates/config/react/package.json +3 -3
  9. package/templates/{web-react → config/react}/tsconfig.app.json +3 -0
  10. package/templates/config/style/package.json +2 -2
  11. package/templates/config/style/stylelint.config.mjs +4 -0
  12. package/templates/config/vscode/package.json +1 -1
  13. package/templates/config/vue/_eslint.config.mjs +5 -0
  14. package/templates/config/vue/env.d.ts +3 -0
  15. package/templates/config/vue/package.json +8 -2
  16. package/templates/{web-vue → config/vue}/tsconfig.app.json +8 -2
  17. package/templates/config/vue/uno.config.ts +9 -0
  18. package/templates/electron-react/vite.config.ts +7 -3
  19. package/templates/electron-vue/package.json +3 -1
  20. package/templates/electron-vue/vite.config.ts +16 -2
  21. package/templates/hbuilderx-react/vite.config.ts +2 -1
  22. package/templates/hbuilderx-vue/tsconfig.app.json +2 -2
  23. package/templates/hbuilderx-vue/vite.config.ts +17 -3
  24. package/templates/node-vite/examples/vue/src/App.vue +3 -3
  25. package/templates/node-vite/examples/vue/src/components/HelloWorld.vue +6 -4
  26. package/templates/vscode-react/vite.config.ts +6 -2
  27. package/templates/vscode-vue/vite.config.ts +16 -2
  28. package/templates/web-react/public/vite.svg +1 -0
  29. package/templates/web-react/vite.config.ts +3 -1
  30. package/templates/web-vue/package.json +3 -0
  31. package/templates/web-vue/public/vite.svg +1 -0
  32. package/templates/web-vue/src/App.vue +3 -3
  33. package/templates/web-vue/src/components/HelloWorld.vue +6 -4
  34. package/templates/web-vue/src/main.ts +1 -1
  35. package/templates/web-vue/vite.config.ts +19 -1
  36. package/templates/vscode-react/tsconfig.app.json +0 -8
  37. package/templates/vscode-vue/tsconfig.app.json +0 -8
  38. /package/templates/{web-react → config/react}/tsconfig.json +0 -0
  39. /package/templates/{web-react → config/react}/tsconfig.node.json +0 -0
  40. /package/templates/{web-vue → config/vue}/tsconfig.json +0 -0
  41. /package/templates/{web-vue → config/vue}/tsconfig.node.json +0 -0
  42. /package/templates/{config/react → electron-react}/public/vite.svg +0 -0
  43. /package/templates/{config/vue → electron-vue}/public/vite.svg +0 -0
  44. /package/templates/web-vue/src/{style.css → style.scss} +0 -0
package/README.md CHANGED
@@ -34,6 +34,7 @@ Usage
34
34
  package-name Package name
35
35
 
36
36
  Options
37
+ --cwd Current working directory
37
38
  --overwrite, -o Overwrite existing project
38
39
  --package, -p Create a package for the workspace project
39
40
  --private Set as private project
@@ -46,6 +47,9 @@ Support templates:
46
47
 
47
48
  - electron-vue
48
49
  - electron-react
50
+ - hbuilderx-base
51
+ - hbuilderx-react
52
+ - hbuilderx-vue
49
53
  - node-base
50
54
  - node-cli
51
55
  - node-vite
package/README.zh_CN.md CHANGED
@@ -34,6 +34,7 @@ Usage
34
34
  package-name 包名称
35
35
 
36
36
  Options
37
+ --cwd 当前工作目录
37
38
  --overwrite, -o 覆盖已存在的目录
38
39
  --package, -p 为 workspace 项目创建包
39
40
  --private 设为私有项目
@@ -46,6 +47,9 @@ Options
46
47
 
47
48
  - electron-vue
48
49
  - electron-react
50
+ - hbuilderx-base
51
+ - hbuilderx-react
52
+ - hbuilderx-vue
49
53
  - node-base
50
54
  - node-cli
51
55
  - node-vite
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tomjs/create-app",
3
3
  "type": "module",
4
- "version": "5.1.0",
4
+ "version": "5.3.0",
5
5
  "description": "Create a node/web/electron/vscode project based on tomjs",
6
6
  "author": {
7
7
  "name": "Tom Gao",
@@ -48,7 +48,7 @@
48
48
  },
49
49
  "dependencies": {
50
50
  "@clack/prompts": "^0.11.0",
51
- "@tomjs/logger": "^1.4.0",
51
+ "@tomjs/logger": "^3.0.0",
52
52
  "@tomjs/node": "^2.2.3",
53
53
  "chalk": "^5.6.2",
54
54
  "dayjs": "^1.11.19",
@@ -58,15 +58,15 @@
58
58
  "tinyglobby": "^0.2.15"
59
59
  },
60
60
  "devDependencies": {
61
- "@antfu/eslint-config": "^6.7.3",
62
- "@commitlint/cli": "^20.3.0",
61
+ "@antfu/eslint-config": "^7.0.1",
62
+ "@commitlint/cli": "^20.3.1",
63
63
  "@tomjs/commitlint": "^5.0.0",
64
- "@tomjs/eslint": "^6.4.0",
65
- "@tomjs/stylelint": "^7.0.0",
66
- "@tomjs/tsconfig": "^3.0.1",
64
+ "@tomjs/eslint": "^7.0.0",
65
+ "@tomjs/stylelint": "^7.1.1",
66
+ "@tomjs/tsconfig": "^3.2.0",
67
67
  "@tsconfig/node20": "^20.1.8",
68
68
  "@types/lodash-es": "^4.17.12",
69
- "@types/node": "^20.19.27",
69
+ "@types/node": "^20.19.30",
70
70
  "dotenv": "^17.2.3",
71
71
  "eslint": "^9.39.2",
72
72
  "lint-staged": "^16.2.7",
@@ -6,6 +6,9 @@
6
6
  "lint": "eslint --fix",
7
7
  "prepare": "simple-git-hooks"
8
8
  },
9
+ "dependencies": {
10
+ "dayjs": "^1.11.19"
11
+ },
9
12
  "devDependencies": {
10
13
  "@antfu/eslint-config": "^6.7.3",
11
14
  "@commitlint/cli": "^20.3.0",
@@ -5,9 +5,9 @@
5
5
  "build": "vite build"
6
6
  },
7
7
  "devDependencies": {
8
- "@tomjs/vite-plugin-electron": "^2.2.0",
8
+ "@tomjs/vite-plugin-electron": "^2.4.2",
9
9
  "electron": "^39.2.7",
10
- "electron-builder": "^26.0.12",
10
+ "electron-builder": "^26.4.0",
11
11
  "vite-plugin-electron-renderer": "^0.14.6"
12
12
  }
13
13
  }
@@ -91,6 +91,6 @@
91
91
  },
92
92
  "devDependencies": {
93
93
  "@tomjs/hbuilderx-cli": "^1.3.1",
94
- "@tomjs/vite-plugin-hbuilderx": "^1.2.0"
94
+ "@tomjs/vite-plugin-hbuilderx": "^1.3.0"
95
95
  }
96
96
  }
@@ -1,38 +1,41 @@
1
1
  {
2
2
  "dependencies": {
3
- "@antfu/eslint-config": "^6.7.3",
3
+ "@antfu/eslint-config": "^7.0.1",
4
4
  "@clack/prompts": "^0.11.0",
5
- "@commitlint/cli": "^20.3.0",
6
- "@eslint-react/eslint-plugin": "^2.5.1",
5
+ "@commitlint/cli": "^20.3.1",
6
+ "@eslint-react/eslint-plugin": "^2.7.1",
7
7
  "@tomjs/commitlint": "^5.0.0",
8
- "@tomjs/eslint": "^6.5.0",
8
+ "@tomjs/eslint": "^7.0.0",
9
9
  "@tomjs/hbuilderx": "^1.2.0",
10
10
  "@tomjs/hbuilderx-cli": "^1.3.1",
11
11
  "@tomjs/logger": "^3.0.0",
12
12
  "@tomjs/node": "^2.2.3",
13
- "@tomjs/stylelint": "^7.0.0",
13
+ "@tomjs/stylelint": "^8.0.0",
14
14
  "@tomjs/tsconfig": "^3.2.0",
15
- "@tomjs/vite-plugin-electron": "^2.3.0",
16
- "@tomjs/vite-plugin-hbuilderx": "^1.2.0",
17
- "@tomjs/vite-plugin-vscode": "^6.1.0",
15
+ "@tomjs/vite-plugin-electron": "^2.4.2",
16
+ "@tomjs/vite-plugin-hbuilderx": "^1.3.0",
17
+ "@tomjs/vite-plugin-vscode": "^7.0.0",
18
18
  "@tomjs/vscode": "^2.5.0",
19
19
  "@tomjs/vscode-dev": "^3.1.2",
20
20
  "@tomjs/vscode-webview": "^2.0.2",
21
- "@types/node": "^20.19.27",
22
- "@types/react": "^19.2.7",
21
+ "@types/node": "^20.19.30",
22
+ "@types/react": "^19.2.8",
23
23
  "@types/react-dom": "^19.2.3",
24
24
  "@types/vscode": "^1.56.0",
25
25
  "@types/vscode-webview": "^1.57.5",
26
+ "@unocss/eslint-plugin": "^66.6.0",
26
27
  "@vitejs/plugin-react": "^5.1.2",
27
28
  "@vitejs/plugin-react-swc": "^4.2.2",
28
29
  "@vitejs/plugin-vue": "^6.0.3",
29
30
  "@vscode/webview-ui-toolkit": "^1.4.0",
30
31
  "@vue/tsconfig": "^0.8.1",
32
+ "@vueuse/core": "^14.1.0",
31
33
  "chalk": "^5.6.2",
32
34
  "cosmiconfig": "^9.0.0",
33
35
  "cross-env": "^10.1.0",
34
- "electron": "^39.2.7",
35
- "electron-builder": "^26.0.12",
36
+ "dayjs": "^1.11.19",
37
+ "electron": "^40.0.0",
38
+ "electron-builder": "^26.4.0",
36
39
  "eslint": "^9.39.2",
37
40
  "eslint-plugin-react-hooks": "^7.0.1",
38
41
  "eslint-plugin-react-refresh": "^0.4.26",
@@ -41,20 +44,25 @@
41
44
  "meow": "^14.0.0",
42
45
  "npm-run-all2": "^8.0.4",
43
46
  "ora": "^9.0.0",
47
+ "pinia": "^3.0.4",
44
48
  "publint": "0.3.16",
45
49
  "react": "^19.2.3",
46
50
  "react-dom": "^19.2.3",
47
51
  "sass": "^1.97.2",
48
52
  "simple-git-hooks": "^2.13.1",
49
- "stylelint": "^16.26.1",
50
- "tsdown": "^0.18.4",
53
+ "stylelint": "^17.0.0",
54
+ "tsdown": "^0.19.0",
51
55
  "tsx": "^4.21.0",
52
56
  "typescript": "~5.9.3",
53
- "vite": "^7.3.0",
57
+ "unocss": "^66.6.0",
58
+ "unplugin-auto-import": "^21.0.0",
59
+ "unplugin-vue-components": "^31.0.0",
60
+ "vite": "^7.3.1",
54
61
  "vite-plugin-electron-renderer": "^0.14.6",
55
62
  "vite-plugin-vue-devtools": "^8.0.5",
56
63
  "vue": "^3.5.26",
57
64
  "vue-i18n": "^11.2.8",
65
+ "vue-router": "^4.6.4",
58
66
  "vue-tsc": "^3.2.2"
59
67
  }
60
68
  }
@@ -4,12 +4,12 @@
4
4
  "react-dom": "^19.2.3"
5
5
  },
6
6
  "devDependencies": {
7
- "@eslint-react/eslint-plugin": "^2.5.0",
8
- "@types/react": "^19.2.7",
7
+ "@eslint-react/eslint-plugin": "^2.5.5",
8
+ "@types/react": "^19.2.8",
9
9
  "@types/react-dom": "^19.2.3",
10
10
  "@vitejs/plugin-react-swc": "^4.2.2",
11
11
  "eslint-plugin-react-hooks": "^7.0.1",
12
12
  "eslint-plugin-react-refresh": "^0.4.26",
13
- "vite": "^7.3.0"
13
+ "vite": "^7.3.1"
14
14
  }
15
15
  }
@@ -2,6 +2,9 @@
2
2
  "extends": "@tomjs/tsconfig/react-dom.json",
3
3
  "compilerOptions": {
4
4
  "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
5
+ "paths": {
6
+ "@/*": ["./src/*"]
7
+ },
5
8
  "types": ["vite/client"]
6
9
  },
7
10
  "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts"]
@@ -5,8 +5,8 @@
5
5
  "lint:eslint": "eslint --fix"
6
6
  },
7
7
  "devDependencies": {
8
- "@tomjs/stylelint": "^7.0.0",
9
- "sass": "^1.97.1",
8
+ "@tomjs/stylelint": "^7.1.1",
9
+ "sass": "^1.97.2",
10
10
  "stylelint": "^16.26.1"
11
11
  }
12
12
  }
@@ -1,3 +1,7 @@
1
+ import { IGNORE_FILES } from '@tomjs/stylelint';
2
+
3
+ /** @type {import('stylelint').Config} */
1
4
  export default {
2
5
  extends: ['@tomjs/stylelint'],
6
+ ignoreFiles: [...IGNORE_FILES],
3
7
  };
@@ -37,7 +37,7 @@
37
37
  "@vscode/webview-ui-toolkit": "^1.4.0"
38
38
  },
39
39
  "devDependencies": {
40
- "@tomjs/vite-plugin-vscode": "^6.1.0",
40
+ "@tomjs/vite-plugin-vscode": "^7.0.0",
41
41
  "@tomjs/vscode-dev": "^3.1.2",
42
42
  "@types/vscode": "^1.56.0",
43
43
  "@types/vscode-webview": "^1.57.5"
@@ -0,0 +1,5 @@
1
+ import defineConfig from '@tomjs/eslint';
2
+
3
+ export default defineConfig({
4
+ unocss: true,
5
+ });
@@ -0,0 +1,3 @@
1
+ /// <reference types="vite/client" />
2
+ /// <reference types="./auto-imports.d.ts" />
3
+ /// <reference types="./components.d.ts" />
@@ -1,11 +1,17 @@
1
1
  {
2
2
  "dependencies": {
3
+ "@vueuse/core": "^14.1.0",
4
+ "pinia": "^3.0.4",
3
5
  "vue": "^3.5.26"
4
6
  },
5
7
  "devDependencies": {
8
+ "@unocss/eslint-plugin": "^66.5.12",
6
9
  "@vitejs/plugin-vue": "^6.0.3",
7
- "vite": "^7.3.0",
10
+ "unocss": "^66.5.12",
11
+ "unplugin-auto-import": "^20.3.0",
12
+ "unplugin-vue-components": "^30.0.0",
13
+ "vite": "^7.3.1",
8
14
  "vite-plugin-vue-devtools": "^8.0.5",
9
- "vue-tsc": "^3.2.1"
15
+ "vue-tsc": "^3.2.2"
10
16
  }
11
17
  }
@@ -2,7 +2,13 @@
2
2
  "extends": "@tomjs/tsconfig/vue-dom.json",
3
3
  "compilerOptions": {
4
4
  "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
5
- "types": ["vite/client"]
5
+ "paths": {
6
+ "@/*": ["./src/*"]
7
+ }
6
8
  },
7
- "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"]
9
+ "include": [
10
+ "env.d.ts",
11
+ "src/**/*",
12
+ "src/**/*.vue"
13
+ ]
8
14
  }
@@ -0,0 +1,9 @@
1
+ import { defineConfig, presetAttributify, presetIcons, presetWind4 } from 'unocss';
2
+
3
+ export default defineConfig({
4
+ presets: [
5
+ presetWind4(),
6
+ presetAttributify(),
7
+ presetIcons({ warn: true }),
8
+ ],
9
+ });
@@ -1,14 +1,18 @@
1
+ import { fileURLToPath, URL } from 'node:url';
1
2
  import electron from '@tomjs/vite-plugin-electron';
2
3
  import react from '@vitejs/plugin-react-swc';
3
4
  import { defineConfig } from 'vite';
4
5
  import renderer from 'vite-plugin-electron-renderer';
5
6
 
6
7
  export default defineConfig({
8
+ resolve: {
9
+ alias: {
10
+ '@': fileURLToPath(new URL('./src', import.meta.url)),
11
+ },
12
+ },
7
13
  plugins: [
8
14
  react(),
9
- electron({
10
- external: ['fs-extra'],
11
- }),
12
15
  renderer(),
16
+ electron(),
13
17
  ],
14
18
  });
@@ -12,7 +12,9 @@
12
12
  "build": "vue-tsc --noEmit && vite build",
13
13
  "release": "vue-tsc --noEmit && cross-env VITE_ELECTRON_BUILDER=1 vite build"
14
14
  },
15
- "dependencies": {},
15
+ "dependencies": {
16
+ "vue-router": "^4.6.4"
17
+ },
16
18
  "devDependencies": {
17
19
  "vite-plugin-electron-renderer": "^0.14.6"
18
20
  }
@@ -1,14 +1,28 @@
1
+ import { fileURLToPath, URL } from 'node:url';
1
2
  import electron from '@tomjs/vite-plugin-electron';
2
3
  import vue from '@vitejs/plugin-vue';
4
+ import UnoCSS from 'unocss/vite';
5
+ import AutoImport from 'unplugin-auto-import/vite';
6
+ import Components from 'unplugin-vue-components/vite';
3
7
  import { defineConfig } from 'vite';
4
8
  import renderer from 'vite-plugin-electron-renderer';
5
9
  import devtools from 'vite-plugin-vue-devtools';
6
10
 
7
11
  export default defineConfig({
12
+ resolve: {
13
+ alias: {
14
+ '@': fileURLToPath(new URL('./src', import.meta.url)),
15
+ },
16
+ },
8
17
  plugins: [
9
18
  vue(),
10
- electron({ builder: true }),
11
- devtools({}),
19
+ AutoImport({
20
+ imports: ['vue', 'vue-router'],
21
+ }),
22
+ Components(),
23
+ UnoCSS(),
12
24
  renderer(),
25
+ electron({ builder: true }),
26
+ devtools(),
13
27
  ],
14
28
  });
@@ -1,4 +1,5 @@
1
1
  import path from 'node:path';
2
+ import { fileURLToPath, URL } from 'node:url';
2
3
  import hbuilderx from '@tomjs/vite-plugin-hbuilderx';
3
4
  import react from '@vitejs/plugin-react-swc';
4
5
  import { defineConfig } from 'vite';
@@ -7,9 +8,9 @@ import { defineConfig } from 'vite';
7
8
  export default defineConfig({
8
9
  resolve: {
9
10
  alias: {
11
+ '@': fileURLToPath(new URL('./src', import.meta.url)),
10
12
  // https://github.com/facebook/react/issues/24928#issuecomment-2267624188
11
13
  'react': path.resolve(process.cwd(), 'node_modules/react'),
12
- '@': '/src',
13
14
  },
14
15
  },
15
16
  build: {
@@ -11,8 +11,8 @@
11
11
  ]
12
12
  },
13
13
  "include": [
14
- "src/**/*.ts",
15
- "src/**/*.d.ts",
14
+ "env.d.ts",
15
+ "src/**/*",
16
16
  "src/**/*.vue"
17
17
  ]
18
18
  }
@@ -1,5 +1,9 @@
1
+ import { fileURLToPath, URL } from 'node:url';
1
2
  import hbuilderx from '@tomjs/vite-plugin-hbuilderx';
2
3
  import vue from '@vitejs/plugin-vue';
4
+ import UnoCSS from 'unocss/vite';
5
+ import AutoImport from 'unplugin-auto-import/vite';
6
+ import Components from 'unplugin-vue-components/vite';
3
7
  import { defineConfig } from 'vite';
4
8
  import devtools from 'vite-plugin-vue-devtools';
5
9
 
@@ -7,11 +11,21 @@ import devtools from 'vite-plugin-vue-devtools';
7
11
  export default defineConfig({
8
12
  resolve: {
9
13
  alias: {
10
- '@': '/src',
14
+ '@': fileURLToPath(new URL('./src', import.meta.url)),
11
15
  },
12
16
  },
13
17
  build: {
14
- assetsInlineLimit: 1024 * 100,
18
+ chunkSizeWarningLimit: 102400,
19
+ reportCompressedSize: false,
15
20
  },
16
- plugins: [vue(), hbuilderx(), devtools()],
21
+ plugins: [
22
+ vue(),
23
+ AutoImport({
24
+ imports: ['vue'],
25
+ }),
26
+ Components(),
27
+ hbuilderx(),
28
+ UnoCSS(),
29
+ devtools(),
30
+ ],
17
31
  });
@@ -1,14 +1,14 @@
1
1
  <script setup lang="ts">
2
- import HelloWorld from './components/HelloWorld.vue'
2
+ import HelloWorld from './components/HelloWorld.vue';
3
3
  </script>
4
4
 
5
5
  <template>
6
6
  <div>
7
7
  <a href="https://vite.dev" target="_blank">
8
- <img src="/vite.svg" class="logo" alt="Vite logo" />
8
+ <img src="/vite.svg" class="logo" alt="Vite logo">
9
9
  </a>
10
10
  <a href="https://vuejs.org/" target="_blank">
11
- <img src="./assets/vue.svg" class="logo vue" alt="Vue logo" />
11
+ <img src="./assets/vue.svg" class="logo vue" alt="Vue logo">
12
12
  </a>
13
13
  </div>
14
14
  <HelloWorld msg="Vite + Vue" />
@@ -1,16 +1,18 @@
1
1
  <script setup lang="ts">
2
- import { ref } from 'vue'
2
+ import { ref } from 'vue';
3
3
 
4
- defineProps<{ msg: string }>()
4
+ defineProps<{ msg: string }>();
5
5
 
6
- const count = ref(0)
6
+ const count = ref(0);
7
7
  </script>
8
8
 
9
9
  <template>
10
10
  <h1>{{ msg }}</h1>
11
11
 
12
12
  <div class="card">
13
- <button type="button" @click="count++">count is {{ count }}</button>
13
+ <button type="button" @click="count++">
14
+ count is {{ count }}
15
+ </button>
14
16
  </div>
15
17
  </template>
16
18
 
@@ -1,4 +1,4 @@
1
- import path from 'node:path';
1
+ import { fileURLToPath, URL } from 'node:url';
2
2
  import vscode from '@tomjs/vite-plugin-vscode';
3
3
  import react from '@vitejs/plugin-react-swc';
4
4
  import { defineConfig } from 'vite';
@@ -8,9 +8,13 @@ export default defineConfig(() => {
8
8
  return {
9
9
  resolve: {
10
10
  alias: {
11
- '@': path.join(__dirname, 'src'),
11
+ '@': fileURLToPath(new URL('./src', import.meta.url)),
12
12
  },
13
13
  },
14
+ build: {
15
+ chunkSizeWarningLimit: 102400,
16
+ reportCompressedSize: false,
17
+ },
14
18
  plugins: [
15
19
  react(),
16
20
  vscode(),
@@ -1,16 +1,24 @@
1
- import path from 'node:path';
1
+ import { fileURLToPath, URL } from 'node:url';
2
2
  import vscode from '@tomjs/vite-plugin-vscode';
3
3
  import vue from '@vitejs/plugin-vue';
4
+ import UnoCSS from 'unocss/vite';
5
+ import AutoImport from 'unplugin-auto-import/vite';
6
+ import Components from 'unplugin-vue-components/vite';
4
7
  import { defineConfig } from 'vite';
8
+ import devtools from 'vite-plugin-vue-devtools';
5
9
 
6
10
  // https://vitejs.dev/config/
7
11
  export default defineConfig(() => {
8
12
  return {
9
13
  resolve: {
10
14
  alias: {
11
- '@': path.join(__dirname, 'src'),
15
+ '@': fileURLToPath(new URL('./src', import.meta.url)),
12
16
  },
13
17
  },
18
+ build: {
19
+ chunkSizeWarningLimit: 102400,
20
+ reportCompressedSize: false,
21
+ },
14
22
  plugins: [
15
23
  vue({
16
24
  template: {
@@ -19,7 +27,13 @@ export default defineConfig(() => {
19
27
  },
20
28
  },
21
29
  }),
30
+ AutoImport({
31
+ imports: ['vue'],
32
+ }),
33
+ Components(),
34
+ UnoCSS(),
22
35
  vscode(),
36
+ devtools(),
23
37
  ],
24
38
  };
25
39
  });
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -1,4 +1,5 @@
1
1
  import path from 'node:path';
2
+ import { fileURLToPath, URL } from 'node:url';
2
3
  import react from '@vitejs/plugin-react-swc';
3
4
  import { defineConfig } from 'vite';
4
5
 
@@ -6,8 +7,9 @@ import { defineConfig } from 'vite';
6
7
  export default defineConfig({
7
8
  resolve: {
8
9
  alias: {
10
+ '@': fileURLToPath(new URL('./src', import.meta.url)),
9
11
  // https://github.com/facebook/react/issues/24928#issuecomment-2267624188
10
- react: path.resolve(process.cwd(), 'node_modules/react'),
12
+ 'react': path.resolve(process.cwd(), 'node_modules/react'),
11
13
  },
12
14
  },
13
15
  plugins: [react()],
@@ -7,5 +7,8 @@
7
7
  "dev": "vite",
8
8
  "build": "vue-tsc -b && vite build",
9
9
  "preview": "vite preview"
10
+ },
11
+ "dependencies": {
12
+ "vue-router": "^4.6.4"
10
13
  }
11
14
  }
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -1,14 +1,14 @@
1
1
  <script setup lang="ts">
2
- import HelloWorld from './components/HelloWorld.vue'
2
+ import HelloWorld from './components/HelloWorld.vue';
3
3
  </script>
4
4
 
5
5
  <template>
6
6
  <div>
7
7
  <a href="https://vite.dev" target="_blank">
8
- <img src="/vite.svg" class="logo" alt="Vite logo" />
8
+ <img src="/vite.svg" class="logo" alt="Vite logo">
9
9
  </a>
10
10
  <a href="https://vuejs.org/" target="_blank">
11
- <img src="./assets/vue.svg" class="logo vue" alt="Vue logo" />
11
+ <img src="./assets/vue.svg" class="logo vue" alt="Vue logo">
12
12
  </a>
13
13
  </div>
14
14
  <HelloWorld msg="Vite + Vue" />
@@ -1,16 +1,18 @@
1
1
  <script setup lang="ts">
2
- import { ref } from 'vue'
2
+ import { ref } from 'vue';
3
3
 
4
- defineProps<{ msg: string }>()
4
+ defineProps<{ msg: string }>();
5
5
 
6
- const count = ref(0)
6
+ const count = ref(0);
7
7
  </script>
8
8
 
9
9
  <template>
10
10
  <h1>{{ msg }}</h1>
11
11
 
12
12
  <div class="card">
13
- <button type="button" @click="count++">count is {{ count }}</button>
13
+ <button type="button" @click="count++">
14
+ count is {{ count }}
15
+ </button>
14
16
  </div>
15
17
  </template>
16
18
 
@@ -1,5 +1,5 @@
1
1
  import { createApp } from 'vue';
2
2
  import App from './App.vue';
3
- import './style.css';
3
+ import './style.scss';
4
4
 
5
5
  createApp(App).mount('#app');
@@ -1,7 +1,25 @@
1
+ import { fileURLToPath, URL } from 'node:url';
1
2
  import vue from '@vitejs/plugin-vue';
3
+ import UnoCSS from 'unocss/vite';
4
+ import AutoImport from 'unplugin-auto-import/vite';
5
+ import Components from 'unplugin-vue-components/vite';
2
6
  import { defineConfig } from 'vite';
7
+ import devtools from 'vite-plugin-vue-devtools';
3
8
 
4
9
  // https://vite.dev/config/
5
10
  export default defineConfig({
6
- plugins: [vue()],
11
+ resolve: {
12
+ alias: {
13
+ '@': fileURLToPath(new URL('./src', import.meta.url)),
14
+ },
15
+ },
16
+ plugins: [
17
+ vue(),
18
+ AutoImport({
19
+ imports: ['vue', 'vue-router'],
20
+ }),
21
+ Components(),
22
+ UnoCSS(),
23
+ devtools(),
24
+ ],
7
25
  });
@@ -1,8 +0,0 @@
1
- {
2
- "extends": "@tomjs/tsconfig/react-dom.json",
3
- "compilerOptions": {
4
- "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
5
- "types": ["vite/client"]
6
- },
7
- "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts"]
8
- }
@@ -1,8 +0,0 @@
1
- {
2
- "extends": "@tomjs/tsconfig/vue-dom.json",
3
- "compilerOptions": {
4
- "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
5
- "types": ["vite/client"]
6
- },
7
- "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", "src/**/*.d.ts"]
8
- }
File without changes
File without changes