File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22 * Postprocess step. Based on babel-jest: https://github.com/facebook/jest/blob/master/packages/babel-jest/src/index.js
33 * https://github.com/facebook/jest/blob/9b157c3a7c325c3971b2aabbe4c8ab4ce0b0c56d/packages/babel-jest/src/index.js
44 */
5- import * as babel from 'babel-core' ;
6- import istanbulPlugin from 'babel-plugin-istanbul' ;
7- import * as jestPreset from 'babel-preset-jest' ;
5+ import * as __types__babel from 'babel-core' ;
6+ import __types__istanbulPlugin from 'babel-plugin-istanbul' ;
7+ import * as __types__jestPreset from 'babel-preset-jest' ;
8+ let babel : typeof __types__babel ;
9+ let istanbulPlugin : typeof __types__istanbulPlugin ;
10+ let jestPreset : typeof __types__jestPreset ;
11+ function importBabelDeps ( ) {
12+ if ( babel ) {
13+ return ;
14+ }
15+ babel = require ( 'babel-core' ) ;
16+ istanbulPlugin = require ( 'babel-plugin-istanbul' ) . default ;
17+ jestPreset = require ( 'babel-preset-jest' ) ;
18+ }
819import { CompilerOptions } from 'typescript/lib/typescript' ;
920import {
1021 BabelTransformOptions ,
@@ -37,6 +48,7 @@ export function postProcessCode(
3748function createBabelTransformer (
3849 options : BabelTransformOptions ,
3950) : PostProcessHook {
51+ importBabelDeps ( ) ;
4052 options = {
4153 ...options ,
4254 plugins : options . plugins || [ ] ,
You can’t perform that action at this time.
0 commit comments