@kevinmarrec/create-app 0.1.0 → 0.2.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.
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/template/frontend/env.d.ts +1 -1
- package/template/frontend/package.json +14 -3
- package/template/frontend/src/composables/index.ts +2 -2
- package/template/frontend/src/main.ts +11 -2
- package/template/frontend/src/utils.ts +1 -1
- package/template/frontend/vite.config.ts +65 -1
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -9,16 +9,27 @@
|
|
|
9
9
|
"preview": "vite preview --open"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
+
"@kevinmarrec/vue-i18n": "^1.0.0",
|
|
12
13
|
"@orpc/client": "^1.8.5",
|
|
13
14
|
"@orpc/tanstack-query": "1.6.4",
|
|
14
15
|
"@tanstack/vue-query": "^5.85.5",
|
|
16
|
+
"@unhead/vue": "^2.0.14",
|
|
17
|
+
"@vueuse/core": "^13.8.0",
|
|
15
18
|
"unocss": "^66.4.2",
|
|
16
19
|
"vue": "^3.5.20"
|
|
17
20
|
},
|
|
18
21
|
"devDependencies": {
|
|
19
|
-
"@kevinmarrec/cloudstack-vite-config": "^1.0.0-rc.15",
|
|
20
|
-
"@kevinmarrec/cloudstack-vue": "^1.0.0-rc.15",
|
|
21
22
|
"@kevinmarrec/unocss-config": "^1.0.0",
|
|
22
|
-
"vite": "^
|
|
23
|
+
"@kevinmarrec/vite-plugin-dark-mode": "^1.0.0",
|
|
24
|
+
"@modyfi/vite-plugin-yaml": "^1.1.1",
|
|
25
|
+
"@unhead/addons": "^2.0.14",
|
|
26
|
+
"@unocss/vite": "^66.4.2",
|
|
27
|
+
"@vitejs/plugin-vue": "^6.0.1",
|
|
28
|
+
"beasties": "^0.3.5",
|
|
29
|
+
"rollup-plugin-visualizer": "^6.0.3",
|
|
30
|
+
"vite": "^7.1.3",
|
|
31
|
+
"vite-plugin-vue-devtools": "^8.0.1",
|
|
32
|
+
"vite-ssg": "^28.1.0",
|
|
33
|
+
"vite-tsconfig-paths": "^5.1.4"
|
|
23
34
|
}
|
|
24
35
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { useI18n } from '@kevinmarrec/vue-i18n'
|
|
2
|
+
export { useHead } from '@unhead/vue'
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
+
import { createI18n } from '@kevinmarrec/vue-i18n'
|
|
1
2
|
import { VueQueryPlugin } from '@tanstack/vue-query'
|
|
2
|
-
import {
|
|
3
|
+
import { ViteSSG } from 'vite-ssg/single-page'
|
|
3
4
|
|
|
4
5
|
import App from './App.vue'
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
import 'uno.css'
|
|
8
|
+
|
|
9
|
+
export const createApp = ViteSSG(App, async ({ app }) => {
|
|
10
|
+
const i18n = await createI18n({
|
|
11
|
+
messages: import.meta.glob('./locales/*.yml'),
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
app.use(i18n)
|
|
15
|
+
|
|
7
16
|
app.use(VueQueryPlugin, {
|
|
8
17
|
enableDevtoolsV6Plugin: true,
|
|
9
18
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { get } from '@
|
|
1
|
+
export { get } from '@vueuse/core'
|
|
@@ -1 +1,65 @@
|
|
|
1
|
-
|
|
1
|
+
import process from 'node:process'
|
|
2
|
+
|
|
3
|
+
import darkMode from '@kevinmarrec/vite-plugin-dark-mode'
|
|
4
|
+
import yaml from '@modyfi/vite-plugin-yaml'
|
|
5
|
+
import unhead from '@unhead/addons/vite'
|
|
6
|
+
import unocss from '@unocss/vite'
|
|
7
|
+
import vue from '@vitejs/plugin-vue'
|
|
8
|
+
import { visualizer } from 'rollup-plugin-visualizer'
|
|
9
|
+
import { defineConfig } from 'vite'
|
|
10
|
+
import devtools from 'vite-plugin-vue-devtools'
|
|
11
|
+
import tsconfigPaths from 'vite-tsconfig-paths'
|
|
12
|
+
|
|
13
|
+
export default defineConfig(({ command, mode }) => ({
|
|
14
|
+
build: {
|
|
15
|
+
modulePreload: {
|
|
16
|
+
polyfill: false,
|
|
17
|
+
},
|
|
18
|
+
sourcemap: mode === 'analyze',
|
|
19
|
+
},
|
|
20
|
+
builder: {
|
|
21
|
+
async buildApp(builder) {
|
|
22
|
+
if (builder.config.mode === 'static') {
|
|
23
|
+
const { build } = await import('vite-ssg/node')
|
|
24
|
+
await build(builder.config.ssgOptions)
|
|
25
|
+
process.exit(0)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
await builder.build(builder.environments.client)
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
plugins: [
|
|
32
|
+
vue({
|
|
33
|
+
features: {
|
|
34
|
+
optionsAPI: command !== 'build',
|
|
35
|
+
},
|
|
36
|
+
}),
|
|
37
|
+
yaml(),
|
|
38
|
+
darkMode(),
|
|
39
|
+
unocss(),
|
|
40
|
+
unhead(),
|
|
41
|
+
tsconfigPaths(),
|
|
42
|
+
devtools({
|
|
43
|
+
componentInspector: {
|
|
44
|
+
toggleComboKey: 'alt-s',
|
|
45
|
+
},
|
|
46
|
+
}),
|
|
47
|
+
mode === 'analyze' && visualizer({
|
|
48
|
+
filename: 'node_modules/.vite/stats.html',
|
|
49
|
+
brotliSize: true,
|
|
50
|
+
gzipSize: true,
|
|
51
|
+
open: true,
|
|
52
|
+
sourcemap: true,
|
|
53
|
+
}),
|
|
54
|
+
],
|
|
55
|
+
ssgOptions: {
|
|
56
|
+
script: 'async',
|
|
57
|
+
formatting: 'minify',
|
|
58
|
+
beastiesOptions: {
|
|
59
|
+
reduceInlineStyles: false,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
ssr: {
|
|
63
|
+
noExternal: ['@kevinmarrec/vue-i18n'],
|
|
64
|
+
},
|
|
65
|
+
}))
|