Skip to content

Compiler fails when using noResolve for global types #10678

Closed
@plwalters

Description

@plwalters

TypeScript Version: 2.0.0

Code

I would like for my build process to output all of the javascript files in a separate folder it works fine. When I want to have a shared set of files that various directories can use I can add a baseUrl and a paths property and it works great. The shared files get built to the same output folder and system.js path takes over to resolve on the client side. Because of the path the output wants to output the entire folder structure, so to prevent that I can use the noResolve option, which works great!

The problem is I start getting errors for missing global types.

ex tsconfig.json

{
  "compileOnSave": false,
  "compilerOptions": {
    "rootDir": "Areas/",
    "outDir": "Areas/Shared/dist",
    "sourceMap": true,
    "target": "es5",
    "module": "amd",
    "declaration": false,
    "noImplicitAny": false,
    "removeComments": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "moduleResolution": "node",
    "lib": ["es2015", "dom"],
    "baseUrl": "Areas",
    "paths": {
        "shared/*": ["Shared/src/*"]
    }
  },
  "filesGlob": [
    "./typings/index.d.ts",
    "./custom_typings/index.d.ts",
    "./Areas/Shared/jspm_packages/**/*.d.ts"
  ],
  "exclude": [
    "node_modules",
    "Areas/Shared/jspm_packages"
  ],
  "atom": {
    "rewriteTsconfig": false
  }
}

errors -

error TS2318: Cannot find global type 'Array'.
error TS2318: Cannot find global type 'Boolean'.
error TS2318: Cannot find global type 'Function'.
error TS2318: Cannot find global type 'IArguments'.
error TS2318: Cannot find global type 'Number'.
error TS2318: Cannot find global type 'Object'.
error TS2318: Cannot find global type 'RegExp'.
error TS2318: Cannot find global type 'String'.

Expected behavior:

No errors should be thrown.

Actual behavior:

Errors are thrown, although the process still finishes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions