Summary: Currently, Flipper Server has a few productions dependencies (mac-ca, node-fetch) that are not bundled with the Flipper Server. It makes it harder to distribute Flipper Server, as now all potential consumers need not only to download the bundle, but also install these additional dependencies. This diff makes it possible to bundle `mac-ca` and `node-fetch` with Flipper Server. As a result, Flipper Server becomes dependency-free in production. Reviewed By: lblasa Differential Revision: D36345213 fbshipit-source-id: 2cd6ba1b3301b45dc2295891964ba020fd107586
39 lines
823 B
TypeScript
39 lines
823 B
TypeScript
/**
|
|
* Copyright (c) Meta Platforms, Inc. and 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';
|
|
import {default as getCacheKey} from './get-cache-key';
|
|
|
|
const presets = [require('@babel/preset-react')];
|
|
const plugins = [
|
|
require('./fsevents-dynamic-imports'),
|
|
require('./prefixed-node-requires'),
|
|
require('./electron-requires'),
|
|
require('./import-react'),
|
|
require('./app-flipper-requires'),
|
|
require('./fb-stubs'),
|
|
];
|
|
|
|
module.exports = {
|
|
transform,
|
|
getCacheKey,
|
|
};
|
|
|
|
function transform({
|
|
filename,
|
|
options,
|
|
src,
|
|
}: {
|
|
filename: string;
|
|
options: any;
|
|
src: string;
|
|
}) {
|
|
return doTransform({filename, options, src, presets, plugins});
|
|
}
|