@gx-design-vue/create-gx-cli 0.0.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/LICENSE +21 -0
- package/README.md +22 -0
- package/bin/create-gx-cli +4 -0
- package/package.json +31 -0
- package/src/cli.js +78 -0
- package/src/main.js +75 -0
- package/template-mobile-ts/.editorconfig +19 -0
- package/template-mobile-ts/.env.development +19 -0
- package/template-mobile-ts/.env.pro +19 -0
- package/template-mobile-ts/.env.production +19 -0
- package/template-mobile-ts/.eslintignore +16 -0
- package/template-mobile-ts/.eslintrc.js +64 -0
- package/template-mobile-ts/.prettierignore +9 -0
- package/template-mobile-ts/.stylelintignore +3 -0
- package/template-mobile-ts/README.md +16 -0
- package/template-mobile-ts/build/cdn.ts +5 -0
- package/template-mobile-ts/build/optimizer.ts +18 -0
- package/template-mobile-ts/build/plugin/autoImport.ts +26 -0
- package/template-mobile-ts/build/plugin/html.ts +26 -0
- package/template-mobile-ts/build/plugin/index.ts +38 -0
- package/template-mobile-ts/build/plugin/mock.ts +20 -0
- package/template-mobile-ts/index.html +24 -0
- package/template-mobile-ts/mock/_createProductionServer.ts +19 -0
- package/template-mobile-ts/mock/api/index.ts +66 -0
- package/template-mobile-ts/mock/utils.ts +9 -0
- package/template-mobile-ts/package.json +57 -0
- package/template-mobile-ts/pnpm-lock.yaml +3890 -0
- package/template-mobile-ts/postcss.config.js +11 -0
- package/template-mobile-ts/prettier.config.js +18 -0
- package/template-mobile-ts/public/favicon.ico +0 -0
- package/template-mobile-ts/public/js/flexible.js +44 -0
- package/template-mobile-ts/src/App.vue +5 -0
- package/template-mobile-ts/src/components/PageContainer/ProSkeleton.tsx +30 -0
- package/template-mobile-ts/src/components/PageContainer/index.tsx +113 -0
- package/template-mobile-ts/src/components/PageContainer/style.module.less +14 -0
- package/template-mobile-ts/src/core/gx-design/index.ts +7 -0
- package/template-mobile-ts/src/core/index.ts +12 -0
- package/template-mobile-ts/src/core/vant-design/index.ts +9 -0
- package/template-mobile-ts/src/design/index.less +3 -0
- package/template-mobile-ts/src/design/reset.less +155 -0
- package/template-mobile-ts/src/design/root.less +3 -0
- package/template-mobile-ts/src/design/vant.less +2 -0
- package/template-mobile-ts/src/global.less +1 -0
- package/template-mobile-ts/src/hooks/web/index.ts +5 -0
- package/template-mobile-ts/src/hooks/web/usePageLoading.ts +58 -0
- package/template-mobile-ts/src/layout/BasicLayout.vue +16 -0
- package/template-mobile-ts/src/layout/basicLayout.less +11 -0
- package/template-mobile-ts/src/main.ts +25 -0
- package/template-mobile-ts/src/router/index.ts +25 -0
- package/template-mobile-ts/src/router/routes.ts +20 -0
- package/template-mobile-ts/src/router/typings.ts +8 -0
- package/template-mobile-ts/src/services/index.ts +31 -0
- package/template-mobile-ts/src/store/index.ts +17 -0
- package/template-mobile-ts/src/store/modules/global.ts +33 -0
- package/template-mobile-ts/src/utils/cryptoJS.ts +25 -0
- package/template-mobile-ts/src/utils/index.ts +52 -0
- package/template-mobile-ts/src/utils/pageTitle.ts +12 -0
- package/template-mobile-ts/src/utils/request.ts +105 -0
- package/template-mobile-ts/src/utils/util.ts +32 -0
- package/template-mobile-ts/src/utils/validate.ts +292 -0
- package/template-mobile-ts/src/views/home.vue +82 -0
- package/template-mobile-ts/stylelint.config.js +106 -0
- package/template-mobile-ts/tsconfig.json +43 -0
- package/template-mobile-ts/types/auto-imports.d.ts +61 -0
- package/template-mobile-ts/types/components.d.ts +17 -0
- package/template-mobile-ts/types/global.d.ts +20 -0
- package/template-mobile-ts/types/gx-components.d.ts +13 -0
- package/template-mobile-ts/types/module.d.ts +9 -0
- package/template-mobile-ts/types/response.d.ts +12 -0
- package/template-mobile-ts/vite.config.ts +100 -0
- package/template-vue-ts/.vscode/extensions.json +3 -0
- package/template-vue-ts/README.md +18 -0
- package/template-vue-ts/index.html +13 -0
- package/template-vue-ts/package.json +20 -0
- package/template-vue-ts/public/vite.svg +1 -0
- package/template-vue-ts/src/App.vue +30 -0
- package/template-vue-ts/src/assets/vue.svg +1 -0
- package/template-vue-ts/src/components/HelloWorld.vue +38 -0
- package/template-vue-ts/src/main.ts +5 -0
- package/template-vue-ts/src/style.css +81 -0
- package/template-vue-ts/src/vite-env.d.ts +1 -0
- package/template-vue-ts/tsconfig.json +18 -0
- package/template-vue-ts/tsconfig.node.json +9 -0
- package/template-vue-ts/vite.config.ts +7 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
root: true,
|
|
3
|
+
plugins: [ 'stylelint-order' ],
|
|
4
|
+
extends: [ 'stylelint-config-standard', 'stylelint-config-prettier' ],
|
|
5
|
+
customSyntax: 'postcss-html',
|
|
6
|
+
rules: {
|
|
7
|
+
'number-leading-zero': false,
|
|
8
|
+
'alpha-value-notation': false,
|
|
9
|
+
'color-function-notation': false,
|
|
10
|
+
'no-eol-whitespace': false,
|
|
11
|
+
'function-no-unknown': null,
|
|
12
|
+
'selector-class-pattern': null,
|
|
13
|
+
'selector-pseudo-class-no-unknown': [
|
|
14
|
+
true,
|
|
15
|
+
{
|
|
16
|
+
ignorePseudoClasses: [ 'global' ]
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
'selector-pseudo-element-no-unknown': [
|
|
20
|
+
true,
|
|
21
|
+
{
|
|
22
|
+
ignorePseudoElements: [ 'v-deep' ]
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
'at-rule-no-unknown': [
|
|
26
|
+
true,
|
|
27
|
+
{
|
|
28
|
+
ignoreAtRules: [
|
|
29
|
+
'tailwind',
|
|
30
|
+
'apply',
|
|
31
|
+
'variants',
|
|
32
|
+
'responsive',
|
|
33
|
+
'screen',
|
|
34
|
+
'function',
|
|
35
|
+
'if',
|
|
36
|
+
'each',
|
|
37
|
+
'include',
|
|
38
|
+
'mixin'
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
'no-empty-source': null,
|
|
43
|
+
'font-family-name-quotes': null,
|
|
44
|
+
'declaration-colon-newline-after': null,
|
|
45
|
+
'selector-pseudo-element-colon-notation': null,
|
|
46
|
+
'string-quotes': null,
|
|
47
|
+
'named-grid-areas-no-invalid': null,
|
|
48
|
+
'unicode-bom': 'never',
|
|
49
|
+
'no-descending-specificity': null,
|
|
50
|
+
'font-family-no-missing-generic-family-keyword': null,
|
|
51
|
+
'declaration-colon-space-after': 'always-single-line',
|
|
52
|
+
'declaration-colon-space-before': 'never',
|
|
53
|
+
'rule-empty-line-before': [
|
|
54
|
+
'always',
|
|
55
|
+
{
|
|
56
|
+
ignore: [ 'after-comment', 'first-nested' ]
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
'unit-no-unknown': [ true, { ignoreUnits: [ 'rpx' ] } ],
|
|
60
|
+
'order/order': [
|
|
61
|
+
[
|
|
62
|
+
'dollar-variables',
|
|
63
|
+
'custom-properties',
|
|
64
|
+
'at-rules',
|
|
65
|
+
'declarations',
|
|
66
|
+
{
|
|
67
|
+
type: 'at-rule',
|
|
68
|
+
name: 'supports'
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
type: 'at-rule',
|
|
72
|
+
name: 'media'
|
|
73
|
+
},
|
|
74
|
+
'rules'
|
|
75
|
+
],
|
|
76
|
+
{ severity: 'warning' }
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
ignoreFiles: [ '**/*.js', '**/*.jsx', '**/*.tsx', '**/*.ts' ],
|
|
80
|
+
overrides: [
|
|
81
|
+
{
|
|
82
|
+
files: [ '*.vue', '**/*.vue', '**/*.ts', '**/*.tsx', '*.html', '**/*.html' ],
|
|
83
|
+
extends: [ 'stylelint-config-recommended', 'stylelint-config-html' ],
|
|
84
|
+
rules: {
|
|
85
|
+
'keyframes-name-pattern': null,
|
|
86
|
+
'selector-pseudo-class-no-unknown': [
|
|
87
|
+
true,
|
|
88
|
+
{
|
|
89
|
+
ignorePseudoClasses: [ 'deep', 'global' ]
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
'selector-pseudo-element-no-unknown': [
|
|
93
|
+
true,
|
|
94
|
+
{
|
|
95
|
+
ignorePseudoElements: [ 'v-deep', 'v-global', 'v-slotted' ]
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
files: [ '*.less', '**/*.less' ],
|
|
102
|
+
customSyntax: 'postcss-less',
|
|
103
|
+
extends: [ 'stylelint-config-standard', 'stylelint-config-recommended-vue' ]
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "esnext",
|
|
4
|
+
"module": "esnext",
|
|
5
|
+
"moduleResolution": "node",
|
|
6
|
+
"forceConsistentCasingInFileNames": true,
|
|
7
|
+
"allowSyntheticDefaultImports": true,
|
|
8
|
+
"strictFunctionTypes": false,
|
|
9
|
+
"jsx": "preserve",
|
|
10
|
+
"baseUrl": "./",
|
|
11
|
+
"scripts": false,
|
|
12
|
+
"noEmit": true,
|
|
13
|
+
"allowJs": true,
|
|
14
|
+
"sourceMap": true,
|
|
15
|
+
"esModuleInterop": true,
|
|
16
|
+
"resolveJsonModule": true,
|
|
17
|
+
"experimentalDecorators": true,
|
|
18
|
+
"lib": ["dom", "esnext"],
|
|
19
|
+
"types": ["vite/client"],
|
|
20
|
+
"typeRoots": ["./node_modules/@types/", "./types"],
|
|
21
|
+
"skipLibCheck": true,
|
|
22
|
+
"paths": {
|
|
23
|
+
"@/*": ["src/*"],
|
|
24
|
+
"@gx-mobile/hooks/*": ["src/hooks/*"],
|
|
25
|
+
"@gx-vuex": ["src/store/index.ts"]
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"include": [
|
|
29
|
+
"tests/**/*.ts",
|
|
30
|
+
"src/**/*.ts",
|
|
31
|
+
"src/**/*.less",
|
|
32
|
+
"src/**/*.d.ts",
|
|
33
|
+
"src/**/*.tsx",
|
|
34
|
+
"src/**/*.vue",
|
|
35
|
+
"types/**/*.d.ts",
|
|
36
|
+
"types/**/*.ts",
|
|
37
|
+
"build/**/*.ts",
|
|
38
|
+
"build/**/*.d.ts",
|
|
39
|
+
"mock/**/*.ts",
|
|
40
|
+
"vite.config.ts"
|
|
41
|
+
],
|
|
42
|
+
"exclude": ["node_modules", "tests/server/**/*.ts", "dist", "**/*.js", ".history"]
|
|
43
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// Generated by 'unplugin-auto-import'
|
|
2
|
+
export {}
|
|
3
|
+
declare global {
|
|
4
|
+
const EffectScope: typeof import('vue')['EffectScope']
|
|
5
|
+
const computed: typeof import('vue')['computed']
|
|
6
|
+
const createApp: typeof import('vue')['createApp']
|
|
7
|
+
const customRef: typeof import('vue')['customRef']
|
|
8
|
+
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
|
|
9
|
+
const defineComponent: typeof import('vue')['defineComponent']
|
|
10
|
+
const effectScope: typeof import('vue')['effectScope']
|
|
11
|
+
const getCurrentInstance: typeof import('vue')['getCurrentInstance']
|
|
12
|
+
const getCurrentScope: typeof import('vue')['getCurrentScope']
|
|
13
|
+
const h: typeof import('vue')['h']
|
|
14
|
+
const inject: typeof import('vue')['inject']
|
|
15
|
+
const isProxy: typeof import('vue')['isProxy']
|
|
16
|
+
const isReactive: typeof import('vue')['isReactive']
|
|
17
|
+
const isReadonly: typeof import('vue')['isReadonly']
|
|
18
|
+
const isRef: typeof import('vue')['isRef']
|
|
19
|
+
const markRaw: typeof import('vue')['markRaw']
|
|
20
|
+
const nextTick: typeof import('vue')['nextTick']
|
|
21
|
+
const onActivated: typeof import('vue')['onActivated']
|
|
22
|
+
const onBeforeMount: typeof import('vue')['onBeforeMount']
|
|
23
|
+
const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave']
|
|
24
|
+
const onBeforeRouteUpdate: typeof import('vue-router')['onBeforeRouteUpdate']
|
|
25
|
+
const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
|
|
26
|
+
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
|
|
27
|
+
const onDeactivated: typeof import('vue')['onDeactivated']
|
|
28
|
+
const onErrorCaptured: typeof import('vue')['onErrorCaptured']
|
|
29
|
+
const onMounted: typeof import('vue')['onMounted']
|
|
30
|
+
const onRenderTracked: typeof import('vue')['onRenderTracked']
|
|
31
|
+
const onRenderTriggered: typeof import('vue')['onRenderTriggered']
|
|
32
|
+
const onScopeDispose: typeof import('vue')['onScopeDispose']
|
|
33
|
+
const onServerPrefetch: typeof import('vue')['onServerPrefetch']
|
|
34
|
+
const onUnmounted: typeof import('vue')['onUnmounted']
|
|
35
|
+
const onUpdated: typeof import('vue')['onUpdated']
|
|
36
|
+
const provide: typeof import('vue')['provide']
|
|
37
|
+
const reactive: typeof import('vue')['reactive']
|
|
38
|
+
const readonly: typeof import('vue')['readonly']
|
|
39
|
+
const ref: typeof import('vue')['ref']
|
|
40
|
+
const resolveComponent: typeof import('vue')['resolveComponent']
|
|
41
|
+
const resolveDirective: typeof import('vue')['resolveDirective']
|
|
42
|
+
const shallowReactive: typeof import('vue')['shallowReactive']
|
|
43
|
+
const shallowReadonly: typeof import('vue')['shallowReadonly']
|
|
44
|
+
const shallowRef: typeof import('vue')['shallowRef']
|
|
45
|
+
const toRaw: typeof import('vue')['toRaw']
|
|
46
|
+
const toRef: typeof import('vue')['toRef']
|
|
47
|
+
const toRefs: typeof import('vue')['toRefs']
|
|
48
|
+
const triggerRef: typeof import('vue')['triggerRef']
|
|
49
|
+
const unref: typeof import('vue')['unref']
|
|
50
|
+
const useAttrs: typeof import('vue')['useAttrs']
|
|
51
|
+
const useCssModule: typeof import('vue')['useCssModule']
|
|
52
|
+
const useCssVars: typeof import('vue')['useCssVars']
|
|
53
|
+
const useLink: typeof import('vue-router')['useLink']
|
|
54
|
+
const useRoute: typeof import('vue-router')['useRoute']
|
|
55
|
+
const useRouter: typeof import('vue-router')['useRouter']
|
|
56
|
+
const useSlots: typeof import('vue')['useSlots']
|
|
57
|
+
const watch: typeof import('vue')['watch']
|
|
58
|
+
const watchEffect: typeof import('vue')['watchEffect']
|
|
59
|
+
const watchPostEffect: typeof import('vue')['watchPostEffect']
|
|
60
|
+
const watchSyncEffect: typeof import('vue')['watchSyncEffect']
|
|
61
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// generated by unplugin-vue-components
|
|
2
|
+
// We suggest you to commit this file into source control
|
|
3
|
+
// Read more: https://github.com/vuejs/core/pull/3399
|
|
4
|
+
import '@vue/runtime-core'
|
|
5
|
+
|
|
6
|
+
export {}
|
|
7
|
+
|
|
8
|
+
declare module '@vue/runtime-core' {
|
|
9
|
+
export interface GlobalComponents {
|
|
10
|
+
RouterLink: typeof import('vue-router')['RouterLink']
|
|
11
|
+
RouterView: typeof import('vue-router')['RouterView']
|
|
12
|
+
VanButton: typeof import('vant/es')['Button']
|
|
13
|
+
VanCell: typeof import('vant/es')['Cell']
|
|
14
|
+
VanSwipe: typeof import('vant/es')['Swipe']
|
|
15
|
+
VanSwipeItem: typeof import('vant/es')['SwipeItem']
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { PropType as VuePropType } from 'vue'
|
|
2
|
+
|
|
3
|
+
declare global {
|
|
4
|
+
declare type PropType<T> = VuePropType<T>;
|
|
5
|
+
|
|
6
|
+
declare type RecordType<T = string, K = any> = Record<string, any>;
|
|
7
|
+
|
|
8
|
+
declare interface ViteEnv {
|
|
9
|
+
VITE_USE_MODE: string;
|
|
10
|
+
VITE_USE_CDN: boolean;
|
|
11
|
+
VITE_USE_MOCK: boolean;
|
|
12
|
+
VITE_USE_V_CONSOLE: boolean;
|
|
13
|
+
VITE_NODE_ENV: string;
|
|
14
|
+
VITE_BASE_URL: string;
|
|
15
|
+
VITE_APP_ENV: string;
|
|
16
|
+
VITE_DROP_CONSOLE: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare type ViteEnvKey = keyof ViteEnv
|
|
20
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// generated by unplugin-vue-components
|
|
2
|
+
// We suggest you to commit this file into source control
|
|
3
|
+
// Read more: https://github.com/vuejs/vue-next/pull/3399
|
|
4
|
+
import '@vue/runtime-core'
|
|
5
|
+
|
|
6
|
+
export {}
|
|
7
|
+
|
|
8
|
+
declare module '@vue/runtime-core' {
|
|
9
|
+
export interface GlobalComponents {
|
|
10
|
+
GProPageContainer: typeof import('./../src/components/PageContainer')['default']
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type { UserConfig, ConfigEnv, ProxyOptions } from 'vite'
|
|
2
|
+
import { loadEnv } from 'vite'
|
|
3
|
+
import { resolve } from 'path'
|
|
4
|
+
|
|
5
|
+
import { configManualChunk } from './build/optimizer'
|
|
6
|
+
import { createVitePlugins } from './build/plugin'
|
|
7
|
+
|
|
8
|
+
function pathResolve(dir: string) {
|
|
9
|
+
return resolve(process.cwd(), '.', dir)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function createProxy(prefix) {
|
|
13
|
+
const ret: RecordType = {}
|
|
14
|
+
const proxy: ProxyOptions = {
|
|
15
|
+
target: 'http://127.0.0.1:3000',
|
|
16
|
+
changeOrigin: true,
|
|
17
|
+
ws: true,
|
|
18
|
+
rewrite: (path) => path.replace(new RegExp(`^${prefix}`), '')
|
|
19
|
+
}
|
|
20
|
+
ret[prefix] = proxy
|
|
21
|
+
return ret
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function wrapperEnv(envConf: RecordType): ViteEnv {
|
|
25
|
+
const ret: any = {}
|
|
26
|
+
|
|
27
|
+
for (const envName of Object.keys(envConf)) {
|
|
28
|
+
let realName = envConf[envName].replace(/\\n/g, '\n')
|
|
29
|
+
realName = realName === 'true' ? true : realName === 'false' ? false : realName
|
|
30
|
+
|
|
31
|
+
ret[envName] = realName
|
|
32
|
+
process.env[envName] = realName
|
|
33
|
+
}
|
|
34
|
+
return ret
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export default ({ mode, command }: ConfigEnv): UserConfig => {
|
|
38
|
+
const root = process.cwd()
|
|
39
|
+
|
|
40
|
+
const env = loadEnv(mode, root)
|
|
41
|
+
|
|
42
|
+
// The boolean type read by loadEnv is a string. This function can be converted to boolean type
|
|
43
|
+
const viteEnv = wrapperEnv(env)
|
|
44
|
+
|
|
45
|
+
const { VITE_BASE_URL } = viteEnv
|
|
46
|
+
|
|
47
|
+
const isBuild = command === 'build'
|
|
48
|
+
|
|
49
|
+
return {
|
|
50
|
+
base: './',
|
|
51
|
+
resolve: {
|
|
52
|
+
alias: [
|
|
53
|
+
{
|
|
54
|
+
find: '@',
|
|
55
|
+
replacement: pathResolve('src') + '/'
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
find: '@gx-vuex',
|
|
59
|
+
replacement: pathResolve('src/store') + '/index.ts'
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
find: '@gx-mobile/hooks',
|
|
63
|
+
replacement: pathResolve('src/hooks')
|
|
64
|
+
},
|
|
65
|
+
{ find: /^~/, replacement: '' }
|
|
66
|
+
]
|
|
67
|
+
},
|
|
68
|
+
server: {
|
|
69
|
+
host: true,
|
|
70
|
+
port: 9260,
|
|
71
|
+
proxy: createProxy(VITE_BASE_URL)
|
|
72
|
+
},
|
|
73
|
+
plugins: createVitePlugins(viteEnv, isBuild),
|
|
74
|
+
build: {
|
|
75
|
+
assetsDir: 'assets',
|
|
76
|
+
target: 'es2015',
|
|
77
|
+
cssTarget: 'chrome80',
|
|
78
|
+
reportCompressedSize: false,
|
|
79
|
+
chunkSizeWarningLimit: 2500,
|
|
80
|
+
commonjsOptions: {
|
|
81
|
+
ignoreTryCatch: false
|
|
82
|
+
},
|
|
83
|
+
rollupOptions: {
|
|
84
|
+
output: {
|
|
85
|
+
manualChunks: configManualChunk
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
css: {
|
|
90
|
+
modules: {
|
|
91
|
+
generateScopedName: 'gx-mobile-[local]-[hash:base64:5]'
|
|
92
|
+
},
|
|
93
|
+
preprocessorOptions: {
|
|
94
|
+
less: {
|
|
95
|
+
javascriptEnabled: true
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Vue 3 + TypeScript + Vite
|
|
2
|
+
|
|
3
|
+
This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
|
|
4
|
+
|
|
5
|
+
## Recommended IDE Setup
|
|
6
|
+
|
|
7
|
+
- [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
|
|
8
|
+
|
|
9
|
+
## Type Support For `.vue` Imports in TS
|
|
10
|
+
|
|
11
|
+
TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.
|
|
12
|
+
|
|
13
|
+
If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:
|
|
14
|
+
|
|
15
|
+
1. Disable the built-in TypeScript Extension
|
|
16
|
+
1. Run `Extensions: Show Built-in Extensions` from VSCode's command palette
|
|
17
|
+
2. Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
|
|
18
|
+
2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>Vite + Vue + TS</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="app"></div>
|
|
11
|
+
<script type="module" src="/src/main.ts"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "vite-vue-typescript-starter",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "vue-tsc && vite build",
|
|
9
|
+
"preview": "vite preview"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"vue": "^3.2.45"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"@vitejs/plugin-vue": "^4.0.0",
|
|
16
|
+
"typescript": "^4.9.3",
|
|
17
|
+
"vite": "^4.0.4",
|
|
18
|
+
"vue-tsc": "^1.0.22"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -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>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import HelloWorld from './components/HelloWorld.vue'
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<div>
|
|
7
|
+
<a href="https://vitejs.dev" target="_blank">
|
|
8
|
+
<img src="/vite.svg" class="logo" alt="Vite logo" />
|
|
9
|
+
</a>
|
|
10
|
+
<a href="https://vuejs.org/" target="_blank">
|
|
11
|
+
<img src="./assets/vue.svg" class="logo vue" alt="Vue logo" />
|
|
12
|
+
</a>
|
|
13
|
+
</div>
|
|
14
|
+
<HelloWorld msg="Vite + Vue" />
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<style scoped>
|
|
18
|
+
.logo {
|
|
19
|
+
height: 6em;
|
|
20
|
+
padding: 1.5em;
|
|
21
|
+
will-change: filter;
|
|
22
|
+
transition: filter 300ms;
|
|
23
|
+
}
|
|
24
|
+
.logo:hover {
|
|
25
|
+
filter: drop-shadow(0 0 2em #646cffaa);
|
|
26
|
+
}
|
|
27
|
+
.logo.vue:hover {
|
|
28
|
+
filter: drop-shadow(0 0 2em #42b883aa);
|
|
29
|
+
}
|
|
30
|
+
</style>
|
|
@@ -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="37.07" height="36" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 198"><path fill="#41B883" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z"></path><path fill="#41B883" d="m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z"></path><path fill="#35495E" d="M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0H50.56Z"></path></svg>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
|
|
4
|
+
defineProps<{ msg: string }>()
|
|
5
|
+
|
|
6
|
+
const count = ref(0)
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<h1>{{ msg }}</h1>
|
|
11
|
+
|
|
12
|
+
<div class="card">
|
|
13
|
+
<button type="button" @click="count++">count is {{ count }}</button>
|
|
14
|
+
<p>
|
|
15
|
+
Edit
|
|
16
|
+
<code>components/HelloWorld.vue</code> to test HMR
|
|
17
|
+
</p>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<p>
|
|
21
|
+
Check out
|
|
22
|
+
<a href="https://vuejs.org/guide/quick-start.html#local" target="_blank"
|
|
23
|
+
>create-vue</a
|
|
24
|
+
>, the official Vue + Vite starter
|
|
25
|
+
</p>
|
|
26
|
+
<p>
|
|
27
|
+
Install
|
|
28
|
+
<a href="https://github.com/johnsoncodehk/volar" target="_blank">Volar</a>
|
|
29
|
+
in your IDE for a better DX
|
|
30
|
+
</p>
|
|
31
|
+
<p class="read-the-docs">Click on the Vite and Vue logos to learn more</p>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<style scoped>
|
|
35
|
+
.read-the-docs {
|
|
36
|
+
color: #888;
|
|
37
|
+
}
|
|
38
|
+
</style>
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
|
|
3
|
+
font-size: 16px;
|
|
4
|
+
line-height: 24px;
|
|
5
|
+
font-weight: 400;
|
|
6
|
+
|
|
7
|
+
color-scheme: light dark;
|
|
8
|
+
color: rgba(255, 255, 255, 0.87);
|
|
9
|
+
background-color: #242424;
|
|
10
|
+
|
|
11
|
+
font-synthesis: none;
|
|
12
|
+
text-rendering: optimizeLegibility;
|
|
13
|
+
-webkit-font-smoothing: antialiased;
|
|
14
|
+
-moz-osx-font-smoothing: grayscale;
|
|
15
|
+
-webkit-text-size-adjust: 100%;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
a {
|
|
19
|
+
font-weight: 500;
|
|
20
|
+
color: #646cff;
|
|
21
|
+
text-decoration: inherit;
|
|
22
|
+
}
|
|
23
|
+
a:hover {
|
|
24
|
+
color: #535bf2;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
body {
|
|
28
|
+
margin: 0;
|
|
29
|
+
display: flex;
|
|
30
|
+
place-items: center;
|
|
31
|
+
min-width: 320px;
|
|
32
|
+
min-height: 100vh;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
h1 {
|
|
36
|
+
font-size: 3.2em;
|
|
37
|
+
line-height: 1.1;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
button {
|
|
41
|
+
border-radius: 8px;
|
|
42
|
+
border: 1px solid transparent;
|
|
43
|
+
padding: 0.6em 1.2em;
|
|
44
|
+
font-size: 1em;
|
|
45
|
+
font-weight: 500;
|
|
46
|
+
font-family: inherit;
|
|
47
|
+
background-color: #1a1a1a;
|
|
48
|
+
cursor: pointer;
|
|
49
|
+
transition: border-color 0.25s;
|
|
50
|
+
}
|
|
51
|
+
button:hover {
|
|
52
|
+
border-color: #646cff;
|
|
53
|
+
}
|
|
54
|
+
button:focus,
|
|
55
|
+
button:focus-visible {
|
|
56
|
+
outline: 4px auto -webkit-focus-ring-color;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.card {
|
|
60
|
+
padding: 2em;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
#app {
|
|
64
|
+
max-width: 1280px;
|
|
65
|
+
margin: 0 auto;
|
|
66
|
+
padding: 2rem;
|
|
67
|
+
text-align: center;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@media (prefers-color-scheme: light) {
|
|
71
|
+
:root {
|
|
72
|
+
color: #213547;
|
|
73
|
+
background-color: #ffffff;
|
|
74
|
+
}
|
|
75
|
+
a:hover {
|
|
76
|
+
color: #747bff;
|
|
77
|
+
}
|
|
78
|
+
button {
|
|
79
|
+
background-color: #f9f9f9;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ESNext",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"moduleResolution": "Node",
|
|
7
|
+
"strict": true,
|
|
8
|
+
"jsx": "preserve",
|
|
9
|
+
"resolveJsonModule": true,
|
|
10
|
+
"isolatedModules": true,
|
|
11
|
+
"esModuleInterop": true,
|
|
12
|
+
"lib": ["ESNext", "DOM"],
|
|
13
|
+
"skipLibCheck": true,
|
|
14
|
+
"noEmit": true
|
|
15
|
+
},
|
|
16
|
+
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
|
|
17
|
+
"references": [{ "path": "./tsconfig.node.json" }]
|
|
18
|
+
}
|