Fix standalone package build for unity plugins
Summary: Fixed error on building standalone packages for "unity" apps. The error was because "immer" imports were not transformed to use "immer" from Flipper bundle. Reviewed By: passy Differential Revision: D22357571 fbshipit-source-id: 590321f36208c9ed02d56d2c0c085c7cd1878018
This commit is contained in:
committed by
Facebook GitHub Bot
parent
91cccbe436
commit
70b87b70c7
@@ -35,6 +35,7 @@ import {addNotification} from '../reducers/notifications';
|
||||
import styled from '@emotion/styled';
|
||||
import {tryCatchReportPluginFailures, reportUsage} from '../utils/metrics';
|
||||
import * as FlipperPluginSDK from 'flipper-plugin';
|
||||
import Immer from 'immer';
|
||||
|
||||
// eslint-disable-next-line import/no-unresolved
|
||||
import getPluginIndex from '../utils/getDefaultPluginsIndex';
|
||||
@@ -52,6 +53,7 @@ export default (store: Store, logger: Logger) => {
|
||||
globalObject.Flipper = Flipper;
|
||||
globalObject.adbkit = adbkit;
|
||||
globalObject.FlipperPlugin = FlipperPluginSDK;
|
||||
globalObject.Immer = Immer;
|
||||
|
||||
const gatekeepedPlugins: Array<PluginDetails> = [];
|
||||
const disabledPlugins: Array<PluginDetails> = [];
|
||||
|
||||
@@ -21,6 +21,7 @@ const requireReplacements: any = {
|
||||
react: 'global.React',
|
||||
'react-dom': 'global.ReactDOM',
|
||||
adbkit: 'global.adbkit',
|
||||
immer: 'global.Immer',
|
||||
};
|
||||
|
||||
export function tryReplaceFlipperRequire(path: NodePath<CallExpression>) {
|
||||
|
||||
Reference in New Issue
Block a user