Summary: This diff changes flipper-pkg to allow using fb-internal code in plugins when they are packaged as standalone packages. It basically transforms fb-stubs/fb folders in plugins in the same way as for Flipper app. Reviewed By: passy Differential Revision: D27173406 fbshipit-source-id: 8ba97d5f57b5e276c19d13270a0d810873504add
29 lines
622 B
TypeScript
29 lines
622 B
TypeScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @format
|
|
*/
|
|
|
|
import {default as doTransform} from './transform';
|
|
|
|
const presets = [require('@babel/preset-react')];
|
|
const plugins = [
|
|
require('./electron-requires'),
|
|
require('./plugin-flipper-requires'),
|
|
require('./fb-stubs'),
|
|
];
|
|
export default function transform({
|
|
filename,
|
|
options,
|
|
src,
|
|
}: {
|
|
filename: string;
|
|
options: any;
|
|
src: string;
|
|
}) {
|
|
return doTransform({filename, options, src, presets, plugins});
|
|
}
|