Nordth / dojo-webpack-loader-examples

Examples for dojo-webpack-loader
MIT License
11 stars 5 forks source link

How to load esri ? #3

Open klanglie opened 7 years ago

klanglie commented 7 years ago

Hi - I have a problem perhaps you can help with. I need to load a dojo module for esri into my Angular2 project. The module is 'extras/ClusterLayer'. SEE: https://developers.arcgis.com/javascript/3/jssamples/layers_point_clustering.html The problem is that I can load just about every other module I need except this one because there are no typings for it. We use Webpack for our project so when I found your code I was hopeful. I would be very grateful for any help. Thanks!

green3g commented 7 years ago

I too have this question. I'm just trying to load 'esri/map' from the 3.x version of the api. An example of this repo set up is here: https://github.com/roemhildtg/webpack-dojo-example

I would really be interested in switching from the dojo-build system to webpack so any suggestions that could get me in the right direction would be awesome.

ERROR in ./dojo/arcgis-js-api/_coremap.js
Module parse failed: /home/gre/public_html/dojo-dijit-webpack-sample/node_modules/dojo-webpack-loader/index.js!/home/gre/public_html/dojo-dijit-webpack-sample/dojo/arcgis-js-api/_coremap.js Unexpected token (25:1075)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (25:1075)
    at Parser.pp$4.raise (/home/gre/public_html/dojo-dijit-webpack-sample/node_modules/acorn/dist/acorn.js:2221:15)
    at Parser.pp.unexpected (/home/gre/public_html/dojo-dijit-webpack-sample/node_modules/acorn/dist/acorn.js:603:10)
    at Parser.pp.semicolon (/home/gre/public_html/dojo-dijit-webpack-sample/node_modules/acorn/dist/acorn.js:581:61)
    at Parser.pp$1.parseExpressionStatement (/home/gre/public_html/dojo-dijit-webpack-sample/node_modules/acorn/dist/acorn.js:966:10)
    at Parser.pp$1.parseStatement (/home/gre/public_html/dojo-dijit-webpack-sample/node_modules/acorn/dist/acorn.js:730:24)
    at Parser.pp$1.parseBlock (/home/gre/public_html/dojo-dijit-webpack-sample/node_modules/acorn/dist/acorn.js:981:25)
    at Parser.pp$3.parseFunctionBody (/home/gre/public_html/dojo-dijit-webpack-sample/node_modules/acorn/dist/acorn.js:2105:24)
    at Parser.pp$1.parseFunction (/home/gre/public_html/dojo-dijit-webpack-sample/node_modules/acorn/dist/acorn.js:1065:10)
    at Parser.pp$3.parseExprAtom (/home/gre/public_html/dojo-dijit-webpack-sample/node_modules/acorn/dist/acorn.js:1810:19)
    at Parser.pp$3.parseExprSubscripts (/home/gre/public_html/dojo-dijit-webpack-sample/node_modules/acorn/dist/acorn.js:1715:21)
    at Parser.pp$3.parseMaybeUnary (/home/gre/public_html/dojo-dijit-webpack-sample/node_modules/acorn/dist/acorn.js:1692:19)
    at Parser.pp$3.parseExprOps (/home/gre/public_html/dojo-dijit-webpack-sample/node_modules/acorn/dist/acorn.js:1637:21)
    at Parser.pp$3.parseMaybeConditional (/home/gre/public_html/dojo-dijit-webpack-sample/node_modules/acorn/dist/acorn.js:1620:21)
    at Parser.pp$3.parseMaybeAssign (/home/gre/public_html/dojo-dijit-webpack-sample/node_modules/acorn/dist/acorn.js:1597:21)
    at Parser.pp$3.parseExprList (/home/gre/public_html/dojo-dijit-webpack-sample/node_modules/acorn/dist/acorn.js:2165:22)
    at Parser.pp$3.parseSubscripts (/home/gre/public_html/dojo-dijit-webpack-sample/node_modules/acorn/dist/acorn.js:1741:35)
    at Parser.pp$3.parseExprSubscripts (/home/gre/public_html/dojo-dijit-webpack-sample/node_modules/acorn/dist/acorn.js:1718:17)
    at Parser.pp$3.parseMaybeUnary (/home/gre/public_html/dojo-dijit-webpack-sample/node_modules/acorn/dist/acorn.js:1692:19)
    at Parser.pp$3.parseExprOps (/home/gre/public_html/dojo-dijit-webpack-sample/node_modules/acorn/dist/acorn.js:1637:21)
    at Parser.pp$3.parseMaybeConditional (/home/gre/public_html/dojo-dijit-webpack-sample/node_modules/acorn/dist/acorn.js:1620:21)
    at Parser.pp$3.parseMaybeAssign (/home/gre/public_html/dojo-dijit-webpack-sample/node_modules/acorn/dist/acorn.js:1597:21)
    at Parser.pp$3.parseExpression (/home/gre/public_html/dojo-dijit-webpack-sample/node_modules/acorn/dist/acorn.js:1573:21)
    at Parser.pp$1.parseStatement (/home/gre/public_html/dojo-dijit-webpack-sample/node_modules/acorn/dist/acorn.js:727:47)
    at Parser.pp$1.parseTopLevel (/home/gre/public_html/dojo-dijit-webpack-sample/node_modules/acorn/dist/acorn.js:638:25)
    at Parser.parse (/home/gre/public_html/dojo-dijit-webpack-sample/node_modules/acorn/dist/acorn.js:516:17)
    at Object.parse (/home/gre/public_html/dojo-dijit-webpack-sample/node_modules/acorn/dist/acorn.js:3098:39)
    at Parser.parse (/home/gre/public_html/dojo-dijit-webpack-sample/node_modules/webpack/lib/Parser.js:902:15)
    at DependenciesBlock.<anonymous> (/home/gre/public_html/dojo-dijit-webpack-sample/node_modules/webpack/lib/NormalModule.js:104:16)
    at DependenciesBlock.onModuleBuild (/home/gre/public_html/dojo-dijit-webpack-sample/node_modules/webpack-core/lib/NormalModuleMixin.js:310:10)
    at nextLoader (/home/gre/public_html/dojo-dijit-webpack-sample/node_modules/webpack-core/lib/NormalModuleMixin.js:275:25)
 @ ./dojo/arcgis-js-api/map.js 25:0-14935

ERROR in ./dojo/arcgis-js-api/nls/jsapi.js
Module build failed: Error: DojoWebpackLoader cannot load nls module /home/gre/public_html/dojo-dijit-webpack-sample/dojo/arcgis-js-api/nls/jsapi.js. ErrorInvalid or unexpected token
    at processNlsModule (/home/gre/public_html/dojo-dijit-webpack-sample/node_modules/dojo-webpack-loader/index.js:201:15)
    at Object.DojoWebpackLoader (/home/gre/public_html/dojo-dijit-webpack-sample/node_modules/dojo-webpack-loader/index.js:245:9)
 @ ./dojo/arcgis-js-api/map.js 25:0-14935