Skip to content

Commit 3989277

Browse files
Michael Edelmanjaredpalmer
authored andcommitted
fix: rollback typescript plugin to avoid babel config conflicts (jaredpalmer#287)
1 parent 9c10c70 commit 3989277

File tree

3 files changed

+65
-251
lines changed

3 files changed

+65
-251
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
"@types/shelljs": "^0.8.5",
4545
"@typescript-eslint/eslint-plugin": "^2.3.1",
4646
"@typescript-eslint/parser": "^2.3.1",
47-
"@wessberg/rollup-plugin-ts": "^1.1.70",
4847
"ansi-escapes": "^4.2.1",
4948
"asyncro": "^3.0.0",
5049
"babel-eslint": "^10.0.3",
@@ -88,6 +87,7 @@
8887
"rollup-plugin-replace": "^2.2.0",
8988
"rollup-plugin-sourcemaps": "^0.4.2",
9089
"rollup-plugin-terser": "^5.1.2",
90+
"rollup-plugin-typescript2": "^0.24.3",
9191
"sade": "^1.4.2",
9292
"shelljs": "^0.8.3",
9393
"tiny-glob": "^0.2.6",

src/createRollupConfig.ts

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ import json from 'rollup-plugin-json';
88
import replace from 'rollup-plugin-replace';
99
import resolve from 'rollup-plugin-node-resolve';
1010
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';
1412
import { extractErrors } from './errors/extractErrors';
1513
import { babelPluginTsdx } from './babelPluginTsdx';
1614
import { TsdxOptions } from './types';
@@ -128,22 +126,22 @@ export function createRollupConfig(opts: TsdxOptions) {
128126
};
129127
},
130128
},
131-
ts({
132-
hook: {
133-
outputPath: (fp, kind) => {
134-
if (/declaration/.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',
137143
},
138144
},
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',
147145
}),
148146
babelPluginTsdx({
149147
exclude: 'node_modules/**',

0 commit comments

Comments
 (0)