Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    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:
    44
    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.