@bemedev/vitest-alias
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

Add tsconfig alias to vitess alias

Check the vitest.config.ts file to see how to use.

Just pass the tsconfig.json file as parameter (the "json", not the "filename")

import { defineConfig } from 'vitest/config';
import { aliasTs } from '@bemedev';
/**
 * Make sure you add "resolveJsonModule": true
 * inside your tsconfig.json at compilerOPtions
 * or write the json file directly
 */
import tsconfig from './tsconfig.json';

export default defineConfig({
  plugins: [aliasTs(tsconfig)],
  test: {
    environment: 'node',
    globals: true,

    coverage: {
      enabled: true,
      extension: 'ts',
      reportsDirectory: '.coverage',
      all: true,
      exclude: ['**/types.ts', '**/index.ts'],
      provider: 'v8',
    },
  },
});

Package Sidebar

Install

npm i @bemedev/vitest-alias

Weekly Downloads

7

Version

0.0.3

License

MIT

Unpacked Size

18 kB

Total Files

15

Last publish

Collaborators

  • bemedev