Select to view content in your preferred language

custom build with esri-js-api and own source code

3688
4
08-20-2015 11:33 PM
deleted-user-OFT1wBX1CgU4
Deactivated User

Hello,

I'd like to know if there is a way to make a custom build of the js-api with own code based on the js-api.

Esri itself doesn't provide a util folder for building the api, so I took the original util folder from the dojo-sdk. If I try to build I get the following error:

js: uncaught JavaScript runtime exception: ReferenceError: "location" is not defined.

According to dojo-ticketsystems and/or threads, this error occurs when one tries to perform a build on a already build dojo. So I tried to replace the compressed dojo folders with the original uncompressed dojo folders (just to check if there is a problem with my profile). Now the build would be performed. Unfortunately Esri brings custom changes at least into the dojo.js file, so this approach wouldn't help since these changes would be lost.

I'd like to create a build where in the best case the build would end up with a single layerfile including all needed dojo & esri stuff + my own code.

How can I get the build system work with provided framework/api from Esri and do all the fine stuff which every dojo-developer can do with the build system?

0 Kudos
4 Replies
JeffJacobson
Frequent Contributor

You're supposed to be able to do that with http://jso.arcgis.com/

0 Kudos
deleted-user-OFT1wBX1CgU4
Deactivated User

The Weboptimizer tells me that my account does not have the access to it. What do I need to get access? Isn't a free developer account enough?

Anyway as far as I unterstood, the weboptimizer just does a build with the dojo & esri stuff or I'm able to bring my source code into this bui8ldprocess?

0 Kudos
JeffJacobson
Frequent Contributor

The help says you should be able to access it with either an ArcGIS for Developers account or an Arc.... You are also supposed to be able to use your own modules via package.json files.

I haven't personally done this so I can't tell you if everything actually works as advertised.

0 Kudos
JoshHevenor
Frequent Contributor

I never really had any success getting the JSO to work.  I'm sure it's fine to minimize the one page apps that in the samples, but I gave up after an hour or so.

My colleague has posted about the build process we maintain, and there's a link to our template on github:

ArcGIS JS API Compiler

0 Kudos