UNPKG

@callstack/repack-plugin-expo-modules

Version:

A plugin for @callstack/repack that integrates Expo Modules

17 lines (16 loc) 553 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ExpoModulesPlugin = void 0; class ExpoModulesPlugin { constructor(options = {}) { this.options = options; } apply(compiler) { const platform = this.options.platform ?? compiler.options.name; // expo modules expect this to be defined in runtime new compiler.webpack.DefinePlugin({ 'process.env.EXPO_OS': JSON.stringify(platform), }).apply(compiler); } } exports.ExpoModulesPlugin = ExpoModulesPlugin;