ern create-miniapp <appName>
Description
- Create a new MiniApp in a new directory named after the MiniApp.
The generated MiniApp is a starter hello world MiniApp
that you can use to launch a standalone MiniApp on the iOS or Android platforms in our Runner—using the ern run-ios
and ern run-android
commands.
If you used react-native previously, you'll notice that the generated JavaScript react-native MiniApp is exactly the same react-native starter app as the one provided by react-native. A MiniApp is simply a react-native application. One of the differences with react-native is that we generate our own native projects which use a locally-generated ern
container.
iOS and Android directories are not generated by this command. To generate those directories, run the ern run-ios
or ern run-android
commands.
Syntax
ern create-miniapp <appName>
Options
--scope <scope>
- Specify the npm scope for the MiniApp package
- Add the scope automatically in the
package.json
file of the generated MiniApp
--platformVersion <version>
- Specify a platform version if different from the currently activated version
- This option is rarely used.
- This option uses the templates and dependency versions bound to a given
ern
platform version to create the MiniApp.
Remarks
- You cannot use any special characters for your MiniApp name, including dashes (-).
- This command is the
ern
equivalent of thereact-native init
command.
Examples
ern create-miniapp MyAwesomeApp
This example shows how to create a directory MyAwesomeApp
containing the generated MiniApp.
ern create-miniapp MyAwesomeApp --scope MyCompany
This example shows how to set the name
field in the package.json
file with @MyCompany/MyAwesomeApp
.