This package has been deprecated

Author message:

This package will no longer be maintained

vitest-ts
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

vitest-ts

Support vitest transform typescript to commonjs

Motivation

vitest is ESM first, cannot handle scene where output is commonjs format, we need to manually convert esm to cjs in the test time.

Install

  pnpm add -D vitest-ts

Usage

common scene

// vitest.config.ts

import { createVitestConfig } from 'vitest-ts'

export default createVitestConfig()({
  // ↓ your vitest config
  test: {
    include: ['./src/**/*.test.ts'],
  },
})

react scene

// vitest.config.ts

import { createVitestConfig } from 'vitest-ts'

export default createVitestConfig({
  target: 'browser',
})({
  // ↓ your vitest config
  test: {
    include: ['./src/**/*.test.{ts,tsx}'],
  },
})

License

MIT

Package Sidebar

Install

npm i vitest-ts

Weekly Downloads

3

Version

1.0.0

License

MIT

Unpacked Size

6.37 kB

Total Files

9

Last publish

Collaborators

  • fz6m