tsconfig.json

This is the config file for ts-loader.
This file specifies compiler options used for building the project
link - typescriptlang.org/docs/handbook/compiler-options.html

{ 
    "compilerOptions": {
        "allowJs": true,

// Allow default imports from modules with no default export (e.g
// import React from "React")
        "allowSyntheticDefaultImports": true,

        "baseUrl": ".",

// Import non-ES modules as default imports.
        "esModuleInterop": true,

        "experimentalDecorators": true,

// Disallow features that require cross-file information for emit.
// Cross-file information is not supported by Babel.
        "isolatedModules": true,

// Support jsx in .tsx files
        "jsx": "preserve",

        "jsx": "react"

// Library files to be used in the project.
// Tells the compiler that "DOM-APIs" and new ECMAScript features are valid.
        "lib": [
           "dom",
           "es2018"
         ],

// Module aliases (if you use module aliases in webpack)

        "module": "commonjs",

// don't emit; only do type-checking, leave transformation to Babel
        "noEmit": true,

        "noEmitOnError": true,

        "outDir": "build",

        "paths": {
             "yourModule": ["./some/modulefile.ts"]
         }

        "sourceMap": false,

// Enable strictest settings like strictNullChecks & noImplicitAny.
        "strict": true,

// which version of ECMAScript to target - (esnext)
        "target": "es6",

    },
    "exclude": [
        "node_modules"
        "dist",
        "lib",
    ]
    "ts-node": {
      "files": true
    }
}

CompilerOptions

disableSizeLimit - disable size limitation on JavaScript project
module - specify module code implementation
allowJS - allow javascript files to be compiled
outDir - redirect output structure to the directory



compileOnSave

generate all the files upon saving


typeAcquisition



exclude





© 2022 Better Solutions Limited. All Rights Reserved. © 2022 Better Solutions Limited TopPrevNext