Skip to content

Commit

Permalink
test(config): fix test:pkg command execute error
Browse files Browse the repository at this point in the history
  • Loading branch information
eyelly-wu committed Apr 4, 2024
1 parent 813ac0a commit 275da07
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/bin/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ import {
RELATIVE_PATH,
FILE_ENCODING,
} from './constants'
const tsNode = require('ts-node')

tsNode.register()

const configPath = join(process.cwd(), JS_CONFIG_NAME)
const tsConfigPath = join(process.cwd(), TS_CONFIG_NAME)
Expand Down Expand Up @@ -59,6 +56,7 @@ function parseTsConfig(props?: {
// 验证文件是否存在
const isExist = fs.existsSync(currentConfigPath)
if (!isExist) return false
require('ts-node').register()
// 通过 ts-node 可以直接加载 .ts 文件
let res = require(currentConfigPath)
if (res.default) {
Expand Down

0 comments on commit 275da07

Please sign in to comment.