Skip to content
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

feat(@angular/cli): Add typings.d.ts to types in TS config #5525

Closed
wants to merge 1 commit into from

Conversation

abdulhaq-e
Copy link
Contributor

Previously adding anything to typings file typings.d.ts
had no effect because the file is not referenced by the
TS compiler. This add the typings.d.ts to the types
array in the generated tsconfig.ts files (app and spec).

Previously adding anything to typings file `typings.d.ts`
had no effect because the file is not referenced by the
TS compiler. This add the `typings.d.ts` to the `types`
array in the generated `tsconfig.ts` files (app and spec).
@hansl
Copy link
Contributor

hansl commented Mar 20, 2017

That file is actually included in the tsconfig now. What's the issue you're trying to solve?

@hansl hansl closed this Mar 20, 2017
@abdulhaq-e
Copy link
Contributor Author

I declared a module in the typings file which I wanted to use while unit testing. That module wasn't identified by the compiler until I added typings.d.ts to types in tsconfig.spec.json. I guessed the same thing would happen while building the app.

@abdulhaq-e
Copy link
Contributor Author

To import a json file I added this to typings.d.ts:

declare module "*.json" {
    const value: any;
    export default value;
}

The import will fail because the compiler doesn't know about the declared module (at least while testing).

@filipesilva
Copy link
Contributor

@abdulhaq-e that was a bug with our configuration, fixed in #5504 and will be on the next release.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants