Esri / calcite-maps

A Bootstrap theme for designing, styling and creating modern map apps.
http://esri.github.io/calcite-maps/samples/index.html
Apache License 2.0
239 stars 173 forks source link

how to use it with webpack #222

Open diminglei opened 5 years ago

diminglei commented 5 years ago

Hi, Could you advise how to use calcite-maps with webpack and arcgis-webpack-plugin. I tried:

  1. download code from https://github.com/odoe/jsapi-bootstrap

  2. modify jsapi-bootstrap/src/config.ts, add calcite-maps modules: { name: "bootstrap", location: "https://esri.github.io/calcite-maps/dist/vendor/dojo-bootstrap" }, { name: "calcite-maps", location: "https://esri.github.io/calcite-maps/dist/js/dojo" },

  3. but it's not working, arcgis said the ersi config is only for the workers in the ArcGIS API for JavaScript, they do not map libraries into your application.

Thanks, Benjamin

MichalisM commented 5 years ago

Having the same issue. Is there any solution or workaround?

Thank you in advance. Michali

crackernutter commented 5 years ago

Nothing yet - having similar issues.....

crackernutter commented 5 years ago

@MichalisM @diminglei @alaframboise I'm been struggling all day to get this to work with webpack and the arcgis-webpack-plugin and have had to make a bunch of edits but have finally gotten it to work.... Of note is the error referenced at https://github.com/OpenNTF/dojo-webpack-plugin/issues/167, which I was receiving. Unfortunately the solution was to change dojo/domReady! to dojo/ready in all modules I was importing. In this case, Dropdown.js in \node_modules\calcite-maps\lib\js\dojo-bootstrap and calcite-maps-arcgis-support-v0.10.js \node_modules\calcite-maps\dist\js\dojo. I don't know if there is a way to change a node_modules dependency programatically (I assume there is through webpack). However, my question for @alaframboise is if there would be any issue to just changing it in the repo itself...

Anyway, there were some other webpack related changes I needed to make, but I think that had more to do with my specific environment (vue-cli). Hope that helps...