pika-minigame-sdk
v1.0.8
Published
SDK for building Pika mini-games with Module Federation
Maintainers
Readme
pika-minigame-sdk
SDK for building Pika mini-games with React Native Module Federation.
Installation
npm install pika-minigame-sdk --save-devUsage
Build Commands
# Build for iOS
npx pika-build ios
# Build for Android
npx pika-build android
# Development build
npx pika-build ios --dev
# Set custom publicPath for production
npx pika-build ios --public-path https://my-game.vercel.app/ios/Package.json Scripts
Add these to your package.json:
{
"scripts": {
"build:ios": "pika-build ios",
"build:android": "pika-build android",
"build:all": "npm run build:ios && npm run build:android",
"serve:ios": "npx serve build/outputs/ios/remotes -l 9000 --cors",
"dev": "npm run build:ios && npm run serve:ios"
}
}Environment Variables
MF_PUBLIC_PATH- Set the publicPath for Module Federation manifest
MF_PUBLIC_PATH=https://my-game.vercel.app/ios/ npm run build:iosWhat's Included
This SDK includes all dependencies needed for Module Federation compatibility:
@callstack/repack- React Native bundler with Module Federation support@module-federation/enhanced- Module Federation runtimereact&react-native- Shared with host app (singleton)react-native-reanimated- Animation libraryreact-native-gesture-handler- Gesture handlingreact-native-safe-area-context- Safe area insetsreact-native-screens- Native navigationreact-native-svg- SVG support
Project Structure
Your mini-game project should have:
my-game/
├── src/
│ └── App.tsx # Main game component (exposed via MF)
├── index.js # Entry point
├── app.json # App metadata
├── package.json
└── babel.config.jsOutput
After building, your game will be in:
build/outputs/
├── ios/
│ └── remotes/
│ ├── my_game.container.js.bundle
│ ├── mf-manifest.json
│ └── *.chunk.bundle
└── android/
└── remotes/
└── ...Compatibility
- React Native: 0.77.0
- React: 18.3.1
- Node.js: >= 18.0.0
License
MIT
