@@ -8,9 +8,7 @@ import json from 'rollup-plugin-json';
8
8
import replace from 'rollup-plugin-replace' ;
9
9
import resolve from 'rollup-plugin-node-resolve' ;
10
10
import sourceMaps from 'rollup-plugin-sourcemaps' ;
11
- import ts from '@wessberg/rollup-plugin-ts' ;
12
- import { ScriptTarget , JsxEmit } from 'typescript' ;
13
- import path from 'path' ;
11
+ import typescript from 'rollup-plugin-typescript2' ;
14
12
import { extractErrors } from './errors/extractErrors' ;
15
13
import { babelPluginTsdx } from './babelPluginTsdx' ;
16
14
import { TsdxOptions } from './types' ;
@@ -128,22 +126,22 @@ export function createRollupConfig(opts: TsdxOptions) {
128
126
} ;
129
127
} ,
130
128
} ,
131
- ts ( {
132
- hook : {
133
- outputPath : ( fp , kind ) => {
134
- if ( / d e c l a r a t i o n / . test ( kind ) && opts . format === 'esm' ) {
135
- return path . join ( path . dirname ( fp ) , 'index.d.ts' ) ;
136
- }
129
+ typescript ( {
130
+ typescript : require ( 'typescript' ) ,
131
+ cacheRoot : `./.rts2_cache_${ opts . format } ` ,
132
+ tsconfig : opts . tsconfig ,
133
+ tsconfigDefaults : {
134
+ compilerOptions : {
135
+ sourceMap : true ,
136
+ declaration : true ,
137
+ jsx : 'react' ,
138
+ } ,
139
+ } ,
140
+ tsconfigOverride : {
141
+ compilerOptions : {
142
+ target : 'esnext' ,
137
143
} ,
138
144
} ,
139
- tsconfig : tsconfig => ( {
140
- ...tsconfig ,
141
- target : ScriptTarget . ESNext ,
142
- sourceMap : true ,
143
- declaration : opts . format === 'esm' ,
144
- jsx : JsxEmit . React ,
145
- } ) ,
146
- transpiler : 'babel' ,
147
145
} ) ,
148
146
babelPluginTsdx ( {
149
147
exclude : 'node_modules/**' ,
0 commit comments