-
Notifications
You must be signed in to change notification settings - Fork 12.8k
ES6 Modules and *.d.ts files with compiler #3658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I think you could try using a tsconfig.json file altough I have not tried this yet but I think it should work. see https://github.com/Microsoft/TypeScript/wiki/tsconfig.json also #2865 |
I did look at using the typescript config file before I even had this problem, but for larger projects it is just un-maintainable to have to put in each file, I know they are working on exclusions but its still not ideal. That aside the tsconfig still interacts with the TSC so if the project notion in tsconfig would fix this, ideally there should be a way to do this manually with TSC without the config file. |
@grofit I am using Phpstorm 9 EAP and gulp-typescript and I do not have any problems with the compiler, no errors, beside 1 where a d.ts file needs updating. I am using the typings folder in the root of my project from https://github.com/cmichaelgraham/aurelia-typescript/tree/master/master/typings. Here is my build.js file if that helps. Also with the latest Phpstorm and Webstorm you can just use new TS ES6 Import statement syntax, ie import 'aurelia-framework' instead of using the old TS require('aureila-framework'). |
Ah I think the reason why yours works is because you have set Also on a side note how come you are compiling for |
Good hope that works for you. As far as commonjs, typescript had a problem awhile ago which is now fixed and I guess I just haven't updated it to systemjs, no particular reason :) |
for anyone else here my issues were down to me using an older version of the aurelia.d.ts file, there is only a temporary 1.5 one which is only available on a specific branch of the above project: https://github.com/cmichaelgraham/aurelia-typescript Also one other thing to note, it complains that it requires a module argument, which I am passing as Anyway problem solved, will close now. |
I am currently working with aurelia which uses ES6 module loading (
System
) and it is great as I do not need to worry about slapping reference tags everywhere. Now my IDEs (VS/Webstorm) know about the d.ts files so while I am developing they know what types come from where. i.e:It knows in the IDE that
aurelia-framework
is included withinaurelia.d.ts
which is in another folder in the solution. So this all resolves great and makes for a much better development experience, however the problem comes when I want to compile my TSC files outside of the IDE.So for example I want to move all my
/src/*.ts
files to/dist/*.js
files, now I am currently using gulp and gulp-typescript passing in the 1.5 beta tsc object for compilation, and it all compiles but the compiler throws up errors like:So I am unsure how to resolve this for the compiler, as the IDE knows its there, and there are no options for me to just tell the TSC where all the
*.d.ts
files live, so is there a way to deal with this? as the IDEs can do it, as they have outside knowledge of the descriptor files so is there some way to just tell to the compiler where all the d.ts files are?Again just want to mention it currently outputs all the *.ts files as *.js files fine and it all works, its just it will spit out a lot of errors giving the impression its not working.
The text was updated successfully, but these errors were encountered: