Building with Reapp is simple and powerful. We offer custom configs, and let you target as many platforms as you want.
The syntax for building looks like this:
reapp build [platform] [options]
Where your platform is a single word. By default, reapp build
will set
the platform to web
. Options are:
-d, --debug output extra information for debugging
--no-assets only build the js
--no-js only build the assets
Running a build will place your app into the ./build/[platform]
folder,
where the default platform is web. Run reapp build ios
and your files
will be built to ./build/ios
.
This separation means you can run multiple builds at the same time and they wont affect each other.
Builds also handle assets for you in a well-defined way. Lets look at an example assets folder:
/assets
/ios
index.html
/images
icon.png
/web
index.html
firebase.json
/shared
Procfile
In this example we have set up our app for ios
and web
builds. When
our build runs it will use Webpack to compile all the assets, and then it
will look into ./assets
and copy them over to the build directory. Say
we ran reapp build ios
, we'd get this in our ./build/ios
folder:
index.html
main.js
main.css
Procfile
/images
icon.png
Notice how the assets from our folders are copied over. Our shared
folder
copies over no matter what platform first, followed by anything in the platform
sub-directory in assets.
Using Reapp with Cordova is incredibly easy. Here's our steps for setting up a workflow that lets you build to XCode in one step:
cordova new appname
cordova platform add ios
rm -r www
ln -s ../PATH_TO_REAPP_APP/build/ios www
reapp build ios && (cd ~/PATH_TO_YOUR_CORDOVA_APP && cordova prepare)
From now you on you run the command from step 7 and it will automatically build and prepare for XCode.
Extra reading: