Skip to content
This repository was archived by the owner on Dec 1, 2019. It is now read-only.

Commit 48eb962

Browse files
committed
feat: allow to specify babelCore
1 parent 0d4f1b6 commit 48eb962

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/host.ts

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export interface ICompilerOptions extends ts.CompilerOptions {
4444
forkChecker?: boolean;
4545
forkCheckerSilent?: boolean;
4646
useBabel?: boolean;
47+
babelCore?: string;
4748
babelOptions?: any;
4849
usePrecompiledFiles?: boolean;
4950
skipDeclarationFilesCheck?: boolean;

src/instance.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,8 @@ export function ensureInstance(webpack: IWebPack, options: ICompilerOptions, ins
199199
let babelImpl: any;
200200
if (options.useBabel) {
201201
try {
202-
babelImpl = require(path.join(process.cwd(), 'node_modules', 'babel-core'));
202+
let babelPath = options.babelCore || path.join(process.cwd(), 'node_modules', 'babel-core');
203+
babelImpl = require(babelPath);
203204
} catch (e) {
204205
console.error(BABEL_ERROR);
205206
process.exit(1);

0 commit comments

Comments
 (0)