tomwayson / esri-webpack-babel

A bare bones example showing how to use the ArcGIS API for JavaScript in an application built with webpack and Babel to compile ES2015 modules.
MIT License
18 stars 2 forks source link

use the same config,and load module by AMD,but not work #7

Closed westfalenxqq closed 7 years ago

westfalenxqq commented 7 years ago

I use the same config image and i load module by amd image but the bundle image expected: define(["dojo/ready"], function(ready) { module.exports = ready; })

tomwayson commented 7 years ago

Can you show the rest of your index.html, in particular your dojoConfig? It is not clear how app will be resolved.

westfalenxqq commented 7 years ago

Thank you for your reply! I init arcgis api by local url,and require the bundle. image

tomwayson commented 7 years ago

So is this working for you now?

westfalenxqq commented 7 years ago

Unfortunately, It not works yet. Webpack dont bundle the external dojo module as expected

tomwayson commented 7 years ago

The dojo modules are not expected to be in the bundles because they are listed in the externals section section of the webpack config. See how it works and this blog post for more information.

Are you seeing a specific error message?

What is "app" and where is that requre() call executed? A module (i.e. a file named app.js), a package, a path? I am not really able to help you when you only provide screenshots of part of your files. There is not enough information here to diagnose what is happening.

westfalenxqq commented 7 years ago

Thank you for your patience! I upload my code on the github esri-webpack-test, I hope it can help you find out the problem.

tomwayson commented 7 years ago

Thank you for uploading the code, but what is the error that I'm looking for?

tomwayson commented 7 years ago

OK, now I see what the problem is.

For what you're trying to do, I would suggest using https://github.com/Esri/angular-esri-map - that library works like esri-loader for Angular 1.x.

We don't have an example of how to use that in an application built with webpack, but I'm sure it could be added to something like https://github.com/preboot/angular-webpack.

You definitely don't want to use that bootstrap.js script with anything but the dojo loader. I would suggest not using it at all.

westfalenxqq commented 7 years ago

Thanks for that blog post,i will try anohter way.