@callstack/repack-plugin-expo-modules
Version:
A plugin for @callstack/repack that integrates Expo Modules
18 lines (17 loc) • 592 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExpoModulesPlugin = void 0;
class ExpoModulesPlugin {
constructor(options = {}) {
this.options = options;
}
apply(__compiler) {
const compiler = __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;