Skip to content

Instantly share code, notes, and snippets.

@fiveisprime
Created April 4, 2016 20:32
Show Gist options
  • Save fiveisprime/dd5b55fcbaffc983b828ddb887817296 to your computer and use it in GitHub Desktop.
Save fiveisprime/dd5b55fcbaffc983b828ddb887817296 to your computer and use it in GitHub Desktop.
Meteor on Modulus

Cross-platform Meteor

This document explains how cross-platform meteor apps work and how to compile them to run on Modulus.

Cordova

Projects setup to compile for multiple platforms (ios and android) will need to compile the client assets into a bundle for those platforms using Cordova as part of the meteor build step. This step must be done on OSX on your local machine.

1. Build for Modulus

You'll need to provide information about the server using some CLI options:

$ meteor build --server leaderboard-45068.onmodulus.net --directory .modulus-deploy --architecture os.linux.x86_64

Replace the value of the --server option with the URL for your project. This should be the same URL that you will set for your ROOT_URL.

This step will generate the bundles for each architecture with the correct URL for interacting with the server-side piece of the app.

2. Edit package.json for Modulus

Open .modulus-deploy/bundle/programs/server/package.json and add the node version:

"engines": { "node": "0.10.40" },

3. Deploy to Modulus

When the build was run, all of the required packages were added to the generated bundle so it's incredibly important to deploy with the --include-modules (-m) flag.

$ modulus deploy --include-modules .modulus-deploy/bundle

This will deploy the server-side bundle only. The bundle may still be very large because all of the packages are included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment