Add browser versions of the transform files.
This commit is contained in:
14
packages/babel-core/src/transform-file-browser.js
Normal file
14
packages/babel-core/src/transform-file-browser.js
Normal file
@@ -0,0 +1,14 @@
|
||||
// @flow
|
||||
import type { FileResult } from "./transformation";
|
||||
|
||||
export default function transformFile(
|
||||
filename: string,
|
||||
opts?: Object = {},
|
||||
callback: (?Error, FileResult | null) => void,
|
||||
) {
|
||||
if (typeof opts === "function") {
|
||||
callback = opts;
|
||||
}
|
||||
|
||||
callback(new Error("Transforming files is not supported in browsers"), null);
|
||||
}
|
||||
5
packages/babel-core/src/transform-file-sync-browser.js
Normal file
5
packages/babel-core/src/transform-file-sync-browser.js
Normal file
@@ -0,0 +1,5 @@
|
||||
// @flow
|
||||
|
||||
export default function transformFileSync() {
|
||||
throw new Error("Transforming files is not supported in browsers");
|
||||
}
|
||||
Reference in New Issue
Block a user