cmichaelgraham / aurelia-typescript

A starter kit for working with the Aurelia TypeScript type definitions
MIT License
144 stars 52 forks source link

skel-nav-esri-vs-ts - defineAlreadyDefined #48

Open ghost opened 8 years ago

ghost commented 8 years ago

I've been working with Aurelia for a couple of months and now our project requires to include ESRI maps.

I'm having trouble including the maps since I get an 'defineAlreadyDefined'. I know the error must be because my project uses AMD module loader (defined in tsconfig) and Dojo is based on AMD too, so it is defined two times.

Since I need to use AMD loader for the rest of my project, is there any way to avoid this error when using ESRI?

Thanks!

cmichaelgraham commented 8 years ago

Hi @avizcaino-newuibcn :) what IDE are you using? VS2013? VS2015, Atom, Sublime, WebStorm, or other? I can point you at a working Aurelia / ESRI / TypeScript sample once I know which IDE you prefer :+1:

ghost commented 8 years ago

I'm using Webstorm

cmichaelgraham commented 8 years ago

ok, i'll update the web storm sample tonight (in 10 hours) :) it just uses require, but i'll redo a version that supports esri and dojo :)

here's its current state

here is a vs2013 that works with esri & dojo at present

cmichaelgraham commented 8 years ago

hi @avizcaino-newuibcn :) i'm digging into your issue. i was first trying to get the webstorm project with require (no esri) running. it looks like you still have to include explicit references to .d.ts files when using web storm. is that your experience? is there a way to get webstorm to use tsconfig.json?

cmichaelgraham commented 8 years ago

ok, so i got the esri sample working using atom & atom-typescript

you can find that here

i may have more time this weekend to get the webstorm working, but probably should update the easy ones first: VS2013, VS2015, Atom, and Sublime Text w/ Gulp-TypeScript

ghost commented 8 years ago

Ok, I give it a look during the morning and tell you if it worked for me. About the tsconfig issue, I discussed it with my partner and told me it may be that webstorm has the typescript compiler enabled, so it is not checking the tsconfig file. Can you check if that is the case?

Thanks for the help!

cmichaelgraham commented 8 years ago

It works !!!! webstorm + typescript + aurelia + esri !!! i'll work on documenting the steps, but i did commit the changes here

basically i turned off the internal typescript compiler, configured a file watcher. the trick is to make sure there are NO args passed to the TSC command, then it uses the tsconfig.json :+1: