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 ADDED
@@ -0,0 +1 @@
1
+ 26
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # 提现记录
1
+ # vue3项目模版
2
2
 
3
3
  This template should help get you started developing with Vue 3 in Vite.
4
4
 
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: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**'],
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.4",
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 . --fix",
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
- "autoprefixer": "^10.4.23",
19
- "axios": "^1.13.2",
19
+ "axios": "^1.21.1",
20
20
  "crypto-js": "^4.2.0",
21
21
  "dsbridge": "^3.1.4",
22
- "fs": "^0.0.1-security",
23
- "js-md5": "^0.8.3",
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.9.22",
27
- "vue": "^3.5.12",
28
- "vue-router": "^4.4.5"
25
+ "vant": "^4.10.2",
26
+ "vue": "^3.5.45",
27
+ "vue-router": "^4.6.5"
29
28
  },
30
29
  "devDependencies": {
31
- "@eslint/js": "^9.14.0",
32
- "@vitejs/plugin-vue": "^5.1.4",
33
- "@vue/eslint-config-prettier": "^10.1.0",
34
- "eslint": "^9.14.0",
35
- "eslint-plugin-vue": "^9.30.0",
36
- "less": "^4.5.1",
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.3.3",
37
+ "prettier": "^3.10.1",
40
38
  "vconsole": "^3.15.1",
41
- "vite": "^5.4.10",
42
- "vite-plugin-vue-devtools": "^7.5.4"
39
+ "vite": "^8.3.8",
40
+ "autoprefixer": "^10.6.2",
41
+ "globals": "^17.14.0"
43
42
  },
44
43
  "engines": {
45
- "node": ">=18"
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 = 'withdrawLog'
10
- const staticVersion = 'BUILD_VERSION'
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
- minify: 'esbuild', // 明确指定
31
+ target: ['es2020'],
32
32
  // 配置代码分割
33
- rollupOptions: {
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
- // fileName: `${outputDir}/version.txt`,
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
  })