Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Unity 2018.3 is now released.
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

TypeScriptError tsconfig.override.json

Discussion in 'Project Tiny' started by Nhatsmall, Feb 10, 2019.

  1. Nhatsmall

    Nhatsmall

    Joined:
    Oct 14, 2014
    Posts:
    1
    When import tsconfig.override.json
    {
    "compilerOptions": {
    "lib": ["es5", "es2015", "dom"]
    },
    }

    upload_2019-2-10_22-12-8.png
     
  2. abeisgreat

    abeisgreat

    Joined:
    Nov 21, 2016
    Posts:
    45
    So the short of this is that it's a bug in the Tiny helper utility.

    To work around it, you need to understand that the config file's "lib" option is a shorthand to include .d.ts files which are included with Typescript. You can manually include these by looking at the Typescript source and copying them into your project.

    The long version of this is that the way Tiny distributes Typescript is by rolling it up with a utility called pkg. This tool wraps up a version of Node with all the dependencies for the Tiny toolchain. It does its best to understand which files are needed in the package and which can be dropped. The TS declaration files aren't there because they aren't statically referenced by the TS compiler so pkg assumes they're not needed.

    This is an easy fix for the Tiny devs, just manually specifying that all of TS's lib/** files be included in the binary, but that'll require another release from them.
     
    raymondyunity likes this.