Skip to content

Commit

Permalink
feat: use ts config
Browse files Browse the repository at this point in the history
  • Loading branch information
ntnyq committed Dec 31, 2023
1 parent 7ba14cd commit f505fc4
Show file tree
Hide file tree
Showing 5 changed files with 2,446 additions and 2,649 deletions.
12 changes: 0 additions & 12 deletions config/dev.js

This file was deleted.

34 changes: 5 additions & 29 deletions config/index.js → config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,17 @@
* @file config
*/

// @ts-check

const path = require('node:path')
const process = require('node:process')
const { defineConfig } = require('taro-define-config')
import path from 'node:path'
import { defineConfig } from 'taro-define-config'

/**
* resolve path
* @param {string[]} args
* @param args
* @returns resolved path
*/
const resolve = (...args) => path.resolve(__dirname, '..', ...args)
const resolve = (...args: string[]) => path.resolve(__dirname, '..', ...args)

const config = defineConfig({
export default defineConfig({
projectName: 'taro-vue3-zhihudaily',
date: '2022-5-21',
designWidth: 750,
Expand Down Expand Up @@ -82,13 +79,6 @@ const config = defineConfig({
limit: 1024, // 设定转换尺寸上限
},
},
cssModules: {
enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
config: {
namingPattern: 'module', // 转换模式,取值为 global/module
generateScopedName: '[name]__[local]___[hash:base64:5]',
},
},
},
},
h5: {
Expand All @@ -100,20 +90,6 @@ const config = defineConfig({
enable: true,
config: {},
},
cssModules: {
enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
config: {
namingPattern: 'module', // 转换模式,取值为 global/module
generateScopedName: '[name]__[local]___[hash:base64:5]',
},
},
},
},
})

module.exports = function (merge) {
if (process.env.NODE_ENV === 'development') {
return merge({}, config, require('./dev'))
}
return merge({}, config, require('./prod'))
}
39 changes: 0 additions & 39 deletions config/prod.js

This file was deleted.

58 changes: 29 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "taro-vue3-zhihudaily",
"version": "0.2.1",
"private": true,
"packageManager": "pnpm@8.10.2",
"packageManager": "pnpm@8.13.1",
"description": "taro-vue3-zhihudaily",
"templateInfo": {
"name": "vue3-NutUI",
Expand All @@ -24,45 +24,45 @@
"typecheck": "vue-tsc --noEmit"
},
"dependencies": {
"@babel/runtime": "^7.23.2",
"@babel/runtime": "^7.23.7",
"@nutui/icons-vue-taro": "^0.0.9",
"@nutui/nutui-taro": "^4.2.0",
"@tarojs/components": "^3.6.18",
"@tarojs/plugin-framework-vue3": "^3.6.18",
"@tarojs/plugin-html": "^3.6.18",
"@tarojs/runtime": "^3.6.18",
"@tarojs/taro": "^3.6.18",
"@nutui/nutui-taro": "^4.2.6",
"@tarojs/components": "^3.6.22",
"@tarojs/plugin-framework-vue3": "^3.6.22",
"@tarojs/plugin-html": "^3.6.22",
"@tarojs/runtime": "^3.6.22",
"@tarojs/taro": "^3.6.22",
"dayjs": "^1.11.10",
"pinia": "^2.1.7",
"taro-plugin-pinia": "^1.0.0",
"vue": "^3.3.8"
"vue": "^3.4.3"
},
"devDependencies": {
"@babel/core": "^7.23.2",
"@babel/core": "^7.23.7",
"@ntnyq/eslint-config": "1.17.0",
"@ntnyq/prettier-config": "^1.17.0",
"@tarojs/cli": "^3.6.18",
"@tarojs/helper": "^3.6.18",
"@tarojs/plugin-platform-weapp": "^3.6.18",
"@tarojs/router": "^3.6.18",
"@tarojs/shared": "^3.6.18",
"@tarojs/webpack5-runner": "^3.6.18",
"@types/webpack-env": "^1.18.3",
"@ntnyq/prettier-config": "^1.20.0",
"@tarojs/cli": "^3.6.22",
"@tarojs/helper": "^3.6.22",
"@tarojs/plugin-platform-weapp": "^3.6.22",
"@tarojs/router": "^3.6.22",
"@tarojs/shared": "^3.6.22",
"@tarojs/webpack5-runner": "^3.6.22",
"@types/webpack-env": "^1.18.4",
"@vue/babel-plugin-jsx": "^1.1.5",
"@vue/compiler-sfc": "^3.3.8",
"babel-preset-taro": "^3.6.18",
"bumpp": "^9.2.0",
"eslint": "^8.53.0",
"@vue/compiler-sfc": "^3.4.3",
"babel-preset-taro": "^3.6.22",
"bumpp": "^9.2.1",
"eslint": "^8.56.0",
"husky": "^8.0.3",
"nano-staged": "^0.8.0",
"pnpm": "^8.10.2",
"postcss": "^8.4.31",
"pnpm": "^8.13.1",
"postcss": "^8.4.32",
"prettier": "3.0.3",
"taro-define-config": "^0.4.2",
"typescript": "^5.2.2",
"unplugin-vue-components": "^0.25.2",
"vue-loader": "^17.3.1",
"vue-tsc": "^1.8.22",
"taro-define-config": "^0.5.2",
"typescript": "^5.3.3",
"unplugin-vue-components": "^0.26.0",
"vue-loader": "^17.4.2",
"vue-tsc": "^1.8.27",
"webpack": "^5.89.0"
},
"engines": {
Expand Down
Loading

0 comments on commit f505fc4

Please sign in to comment.