tk-vue3-template 0.0.4 → 0.0.6
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/.nvmrc +1 -0
- package/README.md +1 -1
- package/eslint.config.js +32 -1
- package/gitignore +30 -0
- package/package.json +22 -22
- package/vite.config.js +22 -24
package/.nvmrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
26
|
package/README.md
CHANGED
package/eslint.config.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import js from '@eslint/js'
|
|
2
2
|
import pluginVue from 'eslint-plugin-vue'
|
|
3
3
|
import skipFormatting from '@vue/eslint-config-prettier/skip-formatting'
|
|
4
|
+
import globals from 'globals'
|
|
4
5
|
|
|
5
6
|
export default [
|
|
6
7
|
{
|
|
@@ -10,10 +11,40 @@ export default [
|
|
|
10
11
|
|
|
11
12
|
{
|
|
12
13
|
name: 'app/files-to-ignore',
|
|
13
|
-
ignores: [
|
|
14
|
+
ignores: [
|
|
15
|
+
'**/dist/**',
|
|
16
|
+
'**/dist-ssr/**',
|
|
17
|
+
'**/coverage/**',
|
|
18
|
+
'dist/**',
|
|
19
|
+
'vite.config.js.timestamp-*.mjs',
|
|
20
|
+
],
|
|
14
21
|
},
|
|
15
22
|
|
|
16
23
|
js.configs.recommended,
|
|
17
24
|
...pluginVue.configs['flat/essential'],
|
|
25
|
+
{
|
|
26
|
+
name: 'app/browser-globals',
|
|
27
|
+
files: ['src/**/*.{js,mjs,jsx,vue}'],
|
|
28
|
+
languageOptions: {
|
|
29
|
+
globals: globals.browser,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'app/request-globals',
|
|
34
|
+
files: ['src/utils/request.js'],
|
|
35
|
+
languageOptions: {
|
|
36
|
+
globals: {
|
|
37
|
+
api_url: 'readonly',
|
|
38
|
+
focus: 'readonly',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'app/node-globals',
|
|
44
|
+
files: ['*.config.js'],
|
|
45
|
+
languageOptions: {
|
|
46
|
+
globals: globals.node,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
18
49
|
skipFormatting,
|
|
19
50
|
]
|
package/gitignore
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Logs
|
|
2
|
+
logs
|
|
3
|
+
*.log
|
|
4
|
+
npm-debug.log*
|
|
5
|
+
yarn-debug.log*
|
|
6
|
+
yarn-error.log*
|
|
7
|
+
pnpm-debug.log*
|
|
8
|
+
lerna-debug.log*
|
|
9
|
+
|
|
10
|
+
node_modules
|
|
11
|
+
.DS_Store
|
|
12
|
+
dist
|
|
13
|
+
dist-ssr
|
|
14
|
+
coverage
|
|
15
|
+
*.local
|
|
16
|
+
|
|
17
|
+
/cypress/videos/
|
|
18
|
+
/cypress/screenshots/
|
|
19
|
+
|
|
20
|
+
# Editor directories and files
|
|
21
|
+
.vscode/*
|
|
22
|
+
!.vscode/extensions.json
|
|
23
|
+
.idea
|
|
24
|
+
*.suo
|
|
25
|
+
*.ntvs*
|
|
26
|
+
*.njsproj
|
|
27
|
+
*.sln
|
|
28
|
+
*.sw?
|
|
29
|
+
|
|
30
|
+
*.tsbuildinfo
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tk-vue3-template",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Vue 3 基础模板(含通用配置)",
|
|
@@ -9,39 +9,39 @@
|
|
|
9
9
|
"dev": "vite",
|
|
10
10
|
"build": "vite build",
|
|
11
11
|
"preview": "vite preview",
|
|
12
|
-
"lint": "eslint . --
|
|
13
|
-
"format": "prettier --write src/"
|
|
12
|
+
"lint": "eslint . --max-warnings 0 --cache --cache-strategy content --cache-location node_modules/.cache/eslint/.eslintcache",
|
|
13
|
+
"format": "prettier --write src/",
|
|
14
|
+
"lint:fix": "eslint . --max-warnings 0 --fix --cache --cache-strategy content --cache-location node_modules/.cache/eslint/.eslintcache"
|
|
14
15
|
},
|
|
15
16
|
"dependencies": {
|
|
16
17
|
"ali-oss": "^6.23.0",
|
|
17
18
|
"amfe-flexible": "^2.2.1",
|
|
18
|
-
"
|
|
19
|
-
"axios": "^1.13.2",
|
|
19
|
+
"axios": "^1.21.1",
|
|
20
20
|
"crypto-js": "^4.2.0",
|
|
21
21
|
"dsbridge": "^3.1.4",
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"pinia": "^2.2.6",
|
|
22
|
+
"js-md5": "^0.9.2",
|
|
23
|
+
"pinia": "^3.0.4",
|
|
25
24
|
"shelljs": "^0.10.0",
|
|
26
|
-
"vant": "^4.
|
|
27
|
-
"vue": "^3.5.
|
|
28
|
-
"vue-router": "^4.
|
|
25
|
+
"vant": "^4.10.2",
|
|
26
|
+
"vue": "^3.5.45",
|
|
27
|
+
"vue-router": "^4.6.5"
|
|
29
28
|
},
|
|
30
29
|
"devDependencies": {
|
|
31
|
-
"@eslint/js": "^
|
|
32
|
-
"@vitejs/plugin-vue": "^
|
|
33
|
-
"@vue/eslint-config-prettier": "^10.
|
|
34
|
-
"eslint": "^
|
|
35
|
-
"eslint-plugin-vue": "^
|
|
36
|
-
"less": "^4.
|
|
37
|
-
"less-loader": "^12.3.0",
|
|
30
|
+
"@eslint/js": "^10.0.1",
|
|
31
|
+
"@vitejs/plugin-vue": "^6.0.11",
|
|
32
|
+
"@vue/eslint-config-prettier": "^10.2.0",
|
|
33
|
+
"eslint": "^10.15.0",
|
|
34
|
+
"eslint-plugin-vue": "^10.12.1",
|
|
35
|
+
"less": "^4.9.1",
|
|
38
36
|
"postcss-pxtorem": "^6.1.0",
|
|
39
|
-
"prettier": "^3.
|
|
37
|
+
"prettier": "^3.10.1",
|
|
40
38
|
"vconsole": "^3.15.1",
|
|
41
|
-
"vite": "^
|
|
42
|
-
"
|
|
39
|
+
"vite": "^8.3.8",
|
|
40
|
+
"autoprefixer": "^10.6.2",
|
|
41
|
+
"globals": "^17.14.0"
|
|
43
42
|
},
|
|
44
43
|
"engines": {
|
|
45
|
-
"node": ">=
|
|
44
|
+
"node": ">=26",
|
|
45
|
+
"pnpm": ">=12"
|
|
46
46
|
}
|
|
47
47
|
}
|
package/vite.config.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { fileURLToPath, URL } from 'node:url'
|
|
2
2
|
|
|
3
|
-
import { defineConfig } from 'vite'
|
|
3
|
+
import { defineConfig, loadEnv } from 'vite'
|
|
4
4
|
import vue from '@vitejs/plugin-vue'
|
|
5
5
|
import autoprefixer from 'autoprefixer'
|
|
6
6
|
import pxtorem from 'postcss-pxtorem'
|
|
7
7
|
|
|
8
8
|
// https://vite.dev/config/
|
|
9
|
-
const outputDir = '
|
|
10
|
-
const
|
|
11
|
-
export default defineConfig(({ mode })=>{
|
|
9
|
+
const outputDir = 'dist'
|
|
10
|
+
const CWD = process.cwd()
|
|
11
|
+
export default defineConfig(({ mode }) => {
|
|
12
12
|
const isProduction = mode === 'production'
|
|
13
|
+
const { VITE_VERSION } = loadEnv(mode, CWD)
|
|
14
|
+
const staticVersion = VITE_VERSION || 'BUILD_VERSION'
|
|
13
15
|
return {
|
|
14
16
|
base: './',
|
|
15
|
-
plugins: [
|
|
16
|
-
vue()
|
|
17
|
-
],
|
|
17
|
+
plugins: [vue()],
|
|
18
18
|
resolve: {
|
|
19
19
|
alias: {
|
|
20
|
-
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
20
|
+
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
21
21
|
},
|
|
22
22
|
},
|
|
23
23
|
server: {
|
|
24
|
-
host: '0.0.0.0',
|
|
25
|
-
port: 3000,
|
|
24
|
+
host: '0.0.0.0', // 允许外部访问
|
|
25
|
+
port: 3000, // 指定端口,可选
|
|
26
26
|
},
|
|
27
27
|
build: {
|
|
28
28
|
outDir: outputDir,
|
|
29
29
|
assetsDir: staticVersion,
|
|
30
30
|
sourcemap: false,
|
|
31
|
-
|
|
31
|
+
target: ['es2020'],
|
|
32
32
|
// 配置代码分割
|
|
33
|
-
|
|
33
|
+
rolldownOptions: {
|
|
34
34
|
plugins: [
|
|
35
35
|
{
|
|
36
36
|
name: 'file-manager-plugin',
|
|
@@ -38,18 +38,17 @@ export default defineConfig(({ mode })=>{
|
|
|
38
38
|
if (isProduction) {
|
|
39
39
|
this.emitFile({
|
|
40
40
|
type: 'asset',
|
|
41
|
-
|
|
42
|
-
source: './version.txt'
|
|
41
|
+
source: './version.txt',
|
|
43
42
|
})
|
|
44
43
|
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
]
|
|
48
|
-
}
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
},
|
|
49
48
|
},
|
|
50
49
|
// 扩展依赖预构建
|
|
51
50
|
optimizeDeps: {
|
|
52
|
-
include: ['vue', 'vue-router', 'pinia', 'vant', 'axios', 'dsbridge']
|
|
51
|
+
include: ['vue', 'vue-router', 'pinia', 'vant', 'axios', 'dsbridge'],
|
|
53
52
|
},
|
|
54
53
|
css: {
|
|
55
54
|
postcss: {
|
|
@@ -58,11 +57,10 @@ export default defineConfig(({ mode })=>{
|
|
|
58
57
|
pxtorem({
|
|
59
58
|
rootValue: 37.5,
|
|
60
59
|
propList: ['*'],
|
|
61
|
-
selectorBlackList: ['van-circle__layer']
|
|
62
|
-
})
|
|
63
|
-
]
|
|
64
|
-
}
|
|
60
|
+
selectorBlackList: ['van-circle__layer'],
|
|
61
|
+
}),
|
|
62
|
+
],
|
|
63
|
+
},
|
|
65
64
|
},
|
|
66
65
|
}
|
|
67
|
-
|
|
68
66
|
})
|