Select to view content in your preferred language

when using the Bower arcgis-js-api package, what controls the install directory?

2931
2
Jump to solution
01-17-2016 09:55 PM
JohnCartwright
Deactivated User

Hello All,

I notice that when using Bower to install a local copy of the ArcGIS for Javascript API, it sometimes installs into the ./dist directory and sometimes into a ./bower_components directory.  It's not clear to me what influences this.

Can someone please explain?

Thanks!

--john

0 Kudos
1 Solution

Accepted Solutions
ReneRubalcava
Honored Contributor

That is controlled via a .bowerrc file.

If you use the sample app on github, it will install into a src directory because we set that up.

jsapi-resources/.bowerrc at master · Esri/jsapi-resources · GitHub

If you just do a bower install arcgis-jsp-api without the .bowerrc file, it will install into bower_components/arcgis-js-api.

We recommend you set up a bower.json ahead of time to install it into an esri directory, to make it easier to use.

{
  "name": "arcgis-js-api-sample-app",
  "version": "1.0.0",
  "license": "Apache-2.0",
  "dependencies": {
  "esri": "arcgis-js-api#3.15.0"
  },
  "resolutions": {
  "dojo": "v1.10.4/esri-3.14.0"
  }
}

You can see this in the demo apps here.

jsapi-resources/bower at master · Esri/jsapi-resources · GitHub

Hope that helps!

View solution in original post

2 Replies
ReneRubalcava
Honored Contributor

That is controlled via a .bowerrc file.

If you use the sample app on github, it will install into a src directory because we set that up.

jsapi-resources/.bowerrc at master · Esri/jsapi-resources · GitHub

If you just do a bower install arcgis-jsp-api without the .bowerrc file, it will install into bower_components/arcgis-js-api.

We recommend you set up a bower.json ahead of time to install it into an esri directory, to make it easier to use.

{
  "name": "arcgis-js-api-sample-app",
  "version": "1.0.0",
  "license": "Apache-2.0",
  "dependencies": {
  "esri": "arcgis-js-api#3.15.0"
  },
  "resolutions": {
  "dojo": "v1.10.4/esri-3.14.0"
  }
}

You can see this in the demo apps here.

jsapi-resources/bower at master · Esri/jsapi-resources · GitHub

Hope that helps!

JohnCartwright
Deactivated User

Thanks Rene, that helps.  I was on the lookout for a .bowerrc file in my project directory but didn't realize that a .bowerrc in the parent directory would also be used and that was the source of my confusion.

--john

0 Kudos