Skip to content

Commit

Permalink
Update(Build): Replace "load-tsconfig" with "get-tsconfig"
Browse files Browse the repository at this point in the history
  • Loading branch information
1aron committed Feb 26, 2024
1 parent 72b0f29 commit 355d496
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
2 changes: 1 addition & 1 deletion packages/techor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@
"escodegen": "^2.1.0",
"execa": "^7.2.0",
"explore-config": "workspace:^",
"get-tsconfig": "^4.7.2",
"hrtime": "^0.5.0",
"load-tsconfig": "^0.2.5",
"lodash.isequal": "^4.5.0",
"pkg-types": "^1.0.1",
"pretty-bytes": "^6.1.0",
Expand Down
5 changes: 2 additions & 3 deletions packages/techor/src/plugins/swc.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { Plugin } from 'rollup'
// @ts-expect-error Cannot find module 'load-tsconfig' or its corresponding type declarations.ts(2307)
import { loadTsConfig } from 'load-tsconfig'
import { getTsconfig } from 'get-tsconfig'
import { Options as SWCOptions, transform } from '@swc/core'
import extend from '@techor/extend'
import { FilterPattern, createFilter } from '@rollup/pluginutils'
Expand All @@ -13,7 +12,7 @@ export type Options = SWCOptions & {

export default function swc({ tsconfigFile, include, exclude, minify, ...options }: Options = {}): Plugin {
const filter = createFilter(include, exclude)
const compilerOptions = tsconfigFile === false ? {} : loadTsConfig('.', tsconfigFile === true ? undefined : tsconfigFile)?.data?.compilerOptions || {}
const compilerOptions = tsconfigFile === false ? {} : getTsconfig('.', tsconfigFile === true ? undefined : tsconfigFile)?.config?.compilerOptions || {}
let swcOptions = {
jsc: {
target: compilerOptions.target,
Expand Down
13 changes: 3 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 355d496

Please sign in to comment.