Clone an app’s Github repository or download a copy of the repository as a zip file.
To build a production version of the application from the source code, you first need to install Node.js.
Then initialize the environment by running the following commands in the Apps folder:
- npm install
- npm install –g grunt-cli
This will create a new node-modules folder in your project root with all the tools required to build the application. If you have trouble running the second command, see this documentation on how to install grunt-cli locally.
How to use the application from the source code
- Make accessible the app’s folder on a web server. Use your favorite server or run one with grunt server, this will start a server on port 8080
- If using a Portal for ArcGIS instance configure the sharing url app/config.js (last property)
- Use the URL parameter appid to specify the web item to be loaded, e.g.: http://localhost:8080/?appid=ABCD (configuring index.html > configOptions.appid is not supported in development mode)
How to build application from the source code
- Open a terminal and navigate to the app’s folder
- Run the following command: grunt
The deploy folder now contains the built application that you can deploy to your web server.
Issues building the application
The build script perform code validation through JSHint, you can disable those validations by editing Gruntfile.js and look for the following comments /* Comment out to disable code linting */.