ttypescript icon indicating copy to clipboard operation
ttypescript copied to clipboard

How to use it in vite?

Open yinzixie opened this issue 3 years ago • 1 comments

Any extra configuration except changes in tsconfig.json ? Because I got an err said

This module should not be used in runtime. Instead, use a transformer during compilation.

Which means the configuration doesn't work at all.

yinzixie avatar Mar 18 '22 06:03 yinzixie

I found an answer from typia documentation: https://github.com/samchon/typia/wiki/Setup#vite.

In my case I configured vite through this vitest.config.ts:

import typescript from '@rollup/plugin-typescript';
import ttsc from 'ttypescript';
import { defineConfig } from 'vitest/config';

export default defineConfig({
  plugins: [typescript({ typescript: ttsc })],
});

ctison avatar Apr 06 '23 20:04 ctison