Skip to content

Commit f505fc4

Browse files
committed
feat: use ts config
1 parent 7ba14cd commit f505fc4

File tree

5 files changed

+2446
-2649
lines changed

5 files changed

+2446
-2649
lines changed

config/dev.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

config/index.js renamed to config/index.ts

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,17 @@
22
* @file config
33
*/
44

5-
// @ts-check
6-
7-
const path = require('node:path')
8-
const process = require('node:process')
9-
const { defineConfig } = require('taro-define-config')
5+
import path from 'node:path'
6+
import { defineConfig } from 'taro-define-config'
107

118
/**
129
* resolve path
13-
* @param {string[]} args
10+
* @param args
1411
* @returns resolved path
1512
*/
16-
const resolve = (...args) => path.resolve(__dirname, '..', ...args)
13+
const resolve = (...args: string[]) => path.resolve(__dirname, '..', ...args)
1714

18-
const config = defineConfig({
15+
export default defineConfig({
1916
projectName: 'taro-vue3-zhihudaily',
2017
date: '2022-5-21',
2118
designWidth: 750,
@@ -82,13 +79,6 @@ const config = defineConfig({
8279
limit: 1024, // 设定转换尺寸上限
8380
},
8481
},
85-
cssModules: {
86-
enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
87-
config: {
88-
namingPattern: 'module', // 转换模式,取值为 global/module
89-
generateScopedName: '[name]__[local]___[hash:base64:5]',
90-
},
91-
},
9282
},
9383
},
9484
h5: {
@@ -100,20 +90,6 @@ const config = defineConfig({
10090
enable: true,
10191
config: {},
10292
},
103-
cssModules: {
104-
enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
105-
config: {
106-
namingPattern: 'module', // 转换模式,取值为 global/module
107-
generateScopedName: '[name]__[local]___[hash:base64:5]',
108-
},
109-
},
11093
},
11194
},
11295
})
113-
114-
module.exports = function (merge) {
115-
if (process.env.NODE_ENV === 'development') {
116-
return merge({}, config, require('./dev'))
117-
}
118-
return merge({}, config, require('./prod'))
119-
}

config/prod.js

Lines changed: 0 additions & 39 deletions
This file was deleted.

package.json

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "taro-vue3-zhihudaily",
33
"version": "0.2.1",
44
"private": true,
5-
"packageManager": "pnpm@8.10.2",
5+
"packageManager": "pnpm@8.13.1",
66
"description": "taro-vue3-zhihudaily",
77
"templateInfo": {
88
"name": "vue3-NutUI",
@@ -24,45 +24,45 @@
2424
"typecheck": "vue-tsc --noEmit"
2525
},
2626
"dependencies": {
27-
"@babel/runtime": "^7.23.2",
27+
"@babel/runtime": "^7.23.7",
2828
"@nutui/icons-vue-taro": "^0.0.9",
29-
"@nutui/nutui-taro": "^4.2.0",
30-
"@tarojs/components": "^3.6.18",
31-
"@tarojs/plugin-framework-vue3": "^3.6.18",
32-
"@tarojs/plugin-html": "^3.6.18",
33-
"@tarojs/runtime": "^3.6.18",
34-
"@tarojs/taro": "^3.6.18",
29+
"@nutui/nutui-taro": "^4.2.6",
30+
"@tarojs/components": "^3.6.22",
31+
"@tarojs/plugin-framework-vue3": "^3.6.22",
32+
"@tarojs/plugin-html": "^3.6.22",
33+
"@tarojs/runtime": "^3.6.22",
34+
"@tarojs/taro": "^3.6.22",
3535
"dayjs": "^1.11.10",
3636
"pinia": "^2.1.7",
3737
"taro-plugin-pinia": "^1.0.0",
38-
"vue": "^3.3.8"
38+
"vue": "^3.4.3"
3939
},
4040
"devDependencies": {
41-
"@babel/core": "^7.23.2",
41+
"@babel/core": "^7.23.7",
4242
"@ntnyq/eslint-config": "1.17.0",
43-
"@ntnyq/prettier-config": "^1.17.0",
44-
"@tarojs/cli": "^3.6.18",
45-
"@tarojs/helper": "^3.6.18",
46-
"@tarojs/plugin-platform-weapp": "^3.6.18",
47-
"@tarojs/router": "^3.6.18",
48-
"@tarojs/shared": "^3.6.18",
49-
"@tarojs/webpack5-runner": "^3.6.18",
50-
"@types/webpack-env": "^1.18.3",
43+
"@ntnyq/prettier-config": "^1.20.0",
44+
"@tarojs/cli": "^3.6.22",
45+
"@tarojs/helper": "^3.6.22",
46+
"@tarojs/plugin-platform-weapp": "^3.6.22",
47+
"@tarojs/router": "^3.6.22",
48+
"@tarojs/shared": "^3.6.22",
49+
"@tarojs/webpack5-runner": "^3.6.22",
50+
"@types/webpack-env": "^1.18.4",
5151
"@vue/babel-plugin-jsx": "^1.1.5",
52-
"@vue/compiler-sfc": "^3.3.8",
53-
"babel-preset-taro": "^3.6.18",
54-
"bumpp": "^9.2.0",
55-
"eslint": "^8.53.0",
52+
"@vue/compiler-sfc": "^3.4.3",
53+
"babel-preset-taro": "^3.6.22",
54+
"bumpp": "^9.2.1",
55+
"eslint": "^8.56.0",
5656
"husky": "^8.0.3",
5757
"nano-staged": "^0.8.0",
58-
"pnpm": "^8.10.2",
59-
"postcss": "^8.4.31",
58+
"pnpm": "^8.13.1",
59+
"postcss": "^8.4.32",
6060
"prettier": "3.0.3",
61-
"taro-define-config": "^0.4.2",
62-
"typescript": "^5.2.2",
63-
"unplugin-vue-components": "^0.25.2",
64-
"vue-loader": "^17.3.1",
65-
"vue-tsc": "^1.8.22",
61+
"taro-define-config": "^0.5.2",
62+
"typescript": "^5.3.3",
63+
"unplugin-vue-components": "^0.26.0",
64+
"vue-loader": "^17.4.2",
65+
"vue-tsc": "^1.8.27",
6666
"webpack": "^5.89.0"
6767
},
6868
"engines": {

0 commit comments

Comments
 (0)