{"name":"awesome-typescript-loader","version":"0.11.3","description":"Awesome TS loader for webpack","main":"dist/index.js","scripts":{"grunt":"grunt","prepublish":"grunt"},"author":{"name":"Stanislav Panferov","email":"fnight.m@gmail.com","url":"http://panferov.me/"},"repository":{"type":"git","url":"git+https://github.com/s-panferov/awesome-typescript-loader.git"},"license":"MIT","keywords":["webpack","loader","webpack-loader","typescript"],"bugs":{"url":"https://github.com/s-panferov/awesome-typescript-loader/issues"},"homepage":"https://github.com/s-panferov/awesome-typescript-loader","dependencies":{"bluebird":"^2.7.1","loader-utils":"^0.2.6","lodash":"^3.10.0","object-assign":"^2.0.0","colors":"^1.1.2"},"devDependencies":{"typescript":"1.6.0-dev.20150801","git-hooks":"0.0.10","grunt":"^0.4.5","grunt-bump":"^0.3.1","grunt-cli":"^0.1.13","grunt-contrib-clean":"^0.6.0","grunt-contrib-copy":"^0.7.0","grunt-conventional-changelog":"^1.2.1","grunt-shell":"^1.1.2","grunt-ts":"^3.0.0","load-grunt-tasks":"^0.6.0"},"gitHead":"6e6c482d583a0a773741c7708843892f139da272","_id":"awesome-typescript-loader@0.11.3","_shasum":"fe404a2ca260c189fbd18cec7ca73e35f0538af3","_from":".","_npmVersion":"2.12.1","_nodeVersion":"0.12.7","_npmUser":{"name":"panferov-s","email":"fnight.m@gmail.com"},"maintainers":[{"name":"panferov-s","email":"fnight.m@gmail.com"}],"dist":{"shasum":"fe404a2ca260c189fbd18cec7ca73e35f0538af3","tarball":"http://registry-npm.ywwl.com/awesome-typescript-loader/download/awesome-typescript-loader-0.11.3.tgz","integrity":"sha512-NjVlwF4REOOtMSI7hZ+dBZrpwoqlN74euLosTUbXEEePq4ouWVxKKl6sxxntnI9wEJohtdsc5K2hsH9HOkCxUQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC7Qc2caaQo/MBS0Z8Gt+wvfRQGw9qCNFyhlldkhTfH2gIhAMHip7ObKecCcnxHoQK0bNjgoM7rD+i59JJpX1ad7xIL"}],"size":133998,"noattachment":false,"key":"/awesome-typescript-loader/-/awesome-typescript-loader-0.11.3.tgz"},"directories":{},"readme":"# TypeScript loader for Webpack\n\n[![Join the chat at https://gitter.im/s-panferov/awesome-typescript-loader](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/s-panferov/awesome-typescript-loader?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n[![Build Status](https://travis-ci.org/s-panferov/awesome-typescript-loader.svg?branch=master)](https://travis-ci.org/s-panferov/awesome-typescript-loader)\n\nSee also:\n\n1. [tygen](https://github.com/s-panferov/tygen) — TypeScript documentation generator.\n\n## Installation\n\n```\nnpm install awesome-typescript-loader --save-dev\n```\n\n## Performance issues\n\nPlease note that ATL works **the same way as a TypeScript compiler** as much as possible. So please be careful with your `files`/`exclude`/`include` sections.\n\n**ADVICE**: Turn on `useCache` option.\n\n**ADVICE**: Typically you want your `files` section to include only entry points.\n\n**ADVICE**: The loader works faster if you use `isolatedModules` or `forceIsolatedModules` options.\n\n**ADVICE**: The loader works faster if you will use `reportFiles` to restrict\nchecking scope.\n\n**ADVICE**: Use the loader together with [hard-source-webpack-plugin](https://github.com/mzgoddard/hard-source-webpack-plugin)\n\nThe world is changing, other solutions are evolving and ATL may work **slower**\nfor [some workloads](https://github.com/s-panferov/awesome-typescript-loader/issues/497). Feel free to try [`ts-loader`](https://github.com/TypeStrong/ts-loader) with [`HappyPack` ](https://github.com/amireh/happypack) or [`thread-loader`](https://webpack.js.org/loaders/thread-loader/) and [hard-source-webpack-plugin](https://github.com/mzgoddard/hard-source-webpack-plugin).\n\n## Differences between [`ts-loader`](https://github.com/TypeStrong/ts-loader)\n\n`awesome-typescript-loader` loader was created mostly to speed-up compilation in my own projects.\nSome of them are quite big and I wanted to have full control on how my files are compiled. There are two major points:\n\n1) atl has first-class integration with Babel and enables caching possibilities. This can be useful for those who use Typescript with Babel.\nWhen `useBabel` and `useCache` flags are enabled, typescript's emit will be transpiled with Babel and cached.\nSo next time if source file (+environment) has the same checksum we can totally skip typescript's and babel's transpiling.\nThis significantly reduces build time in this scenario.\n\n2) atl is able to fork type-checker and emitter to a separate process, which also speeds-up some development scenarios (e.g. react with react-hot-loader)\nSo your webpack compilation will end earlier and you can explore compiled version in your browser while your files are typechecked.\n\n## Configuration\n\n1. Add `.ts` as a resolvable extension.\n2. Configure all files with a `.ts` extension to be handled by `awesome-typescript-loader`.\n\n**webpack.config.js**\n\n```javascript\n// `CheckerPlugin` is optional. Use it if you want async error reporting.\n// We need this plugin to detect a `--watch` mode. It may be removed later\n// after https://github.com/webpack/webpack/issues/3460 will be resolved.\nconst { CheckerPlugin } = require('awesome-typescript-loader')\n\nmodule.exports = {\n\n  // Currently we need to add '.ts' to the resolve.extensions array.\n  resolve: {\n    extensions: ['.ts', '.tsx', '.js', '.jsx']\n  },\n\n  // Source maps support ('inline-source-map' also works)\n  devtool: 'source-map',\n\n  // Add the loader for .ts files.\n  module: {\n    rules: [\n      {\n        test: /\\.tsx?$/,\n        loader: 'awesome-typescript-loader'\n      }\n    ]\n  },\n  plugins: [\n      new CheckerPlugin()\n  ]\n};\n```\n\nAfter that, you will be able to build TypeScript files with webpack.\n\n## NodeJS versions\n\n**The loader supports NodeJS 4 and newer.**\n\n## tsconfig.json\n\nYou can use the tsconfig.json file to configure your compiler and loader:\n\n```\n{\n    \"compilerOptions\": {\n        \"noImplicitAny\": true,\n        \"removeComments\": true\n    },\n    \"awesomeTypescriptLoaderOptions\": {\n        /* ... */\n    }\n}\n```\n\n## Supported TypeScript\n\n`awesome-typescript-loader@2.x` aims to support only `typescript@2.x` and `webpack@2x`, if you need old compilers please use\n`1.x` or `0.x` versions.\n\n## Advanced path resolution in TypeScript 2.0\n\nIf you want to use new `paths` and `baseUrl` feature of TS 2.0 please include `TsConfigPathsPlugin`.\nThis feature is available only for `webpack@2.1`.\n\n```\nconst { TsConfigPathsPlugin } = require('awesome-typescript-loader');\n\nresolve: {\n    plugins: [\n        new TsConfigPathsPlugin(/* { configFileName, compiler } */)\n    ]\n}\n```\n\n## Loader options\n\n### silent *(boolean) (default=false)*\n\nNo logging from the checker. Please note that this option disables async error reporting because\nthis option bans `console.log()` usage.\n\n### compiler *(string) (default='typescript')*\n\nAllows use of TypeScript compilers other than the official one. Must be\nset to the NPM name of the compiler, e.g. *ntypescript* or the path to a package folder.\nNote that the compiler must be installed in **your** project. You can also use\nnightly versions.\n\n### useTranspileModule (boolean) (default=false)*\n\nUse fast `transpileModule` emit mode. Disables automatically when you set compilerOption `declaration: true` ([reference](https://www.typescriptlang.org/docs/handbook/compiler-options.html)).\n\n### instance *(string) (default='at-loader')*\n\nAllows the use of several TypeScript compilers with different settings in one app. Override `instance` to initialize another instance.\n\n### configFileName *(string) (default='tsconfig.json')*\n\nSpecifies the path to a TS config file. This is useful when you have multiple config files. This setting is useless *inside* a TS config file.\n\n### transpileOnly *(boolean)*\n\nUse this setting to disable type checking, enabling this will nullify the `CheckerPlugin` usage in your webpack configuration.\n\n### errorsAsWarnings *(boolean)*\n\nEmit all typescript errors as warnings.\n\n### forceIsolatedModules *(boolean)*\n\nUse this setting to disable dependent module recompilation.\n\n### ignoreDiagnostics *(number[]) (default=[])*\n\nYou can squelch certain TypeScript errors by specifying an array of [diagnostic codes](https://github.com/Microsoft/TypeScript/blob/master/src/compiler/diagnosticMessages.json) to ignore.\nFor example, you can transpile [stage 1 properties](https://github.com/jeffmo/es-class-fields-and-static-properties) from `*.js` using `\"ignoreDiagnostics\": [8014]`.\n\n### useBabel *(boolean) (default=false)*\n\nInvoke Babel to transpile files. Useful with ES6 target. Please see `useCache` option\nwhich can improve warm-up time.\n\nIf you're using `babelOptions`, anything in `.babelrc` will take precedence. This breaks expected usage for scenarios where you need two sets of Babel configs (example: one for Webpack, one for your build tools).\n\nYou may want to `\"babelrc\": false` to disable `.babelrc` if you don't want it:\n\n```json\n{\n    \"useBabel\": true,\n    \"babelOptions\": {\n        \"babelrc\": false, /* Important line */\n        \"presets\": [\n            [\"@babel/preset-env\", { \"targets\": \"last 2 versions, ie 11\", \"modules\": false }]\n        ]\n    },\n    \"babelCore\": \"@babel/core\", // needed for Babel v7\n}\n```\n\n### babelCore *(string) (default=undefined)*\n\nOverride the path used to find `babel-core`. Useful if `node_modules` is installed in a non-standard place or webpack is being invoked from a directory not at the root of the project.\n\nFor Babel 7, this should be set to `\"@babel/core\"`.\n\n### babelOptions *(object) (default=null)*\n\nUse this option to pass some options to Babel (e.g. presets). Please note that\n[`.babelrc` file](https://babeljs.io/docs/usage/babelrc/) is more universal way to do this.\n\n### useCache *(boolean) (default=false)*\n\nUse internal file cache. This is useful with Babel, when processing takes a long time to complete. Improves warm-up time.\n\n### usePrecompiledFiles *(boolean) (default=false)*\n\nUse pre-compiled files if any. Files must be named as `{filename}.js` and `{filename}.map`.\n\n### cacheDirectory *(string) (default='.awcache')*\n\nDirectory where cache is stored.\n\n### reportFiles *(string[])*\n\nSpecify [globs](https://github.com/isaacs/minimatch) to report file diagnostics. ALL OTHER ERRORS WILL NOT BE REPORTED. Example:\n\n```\nreportFiles: [\n    \"src/**/*.{ts,tsx}\"\n]\n```\n\n### getCustomTransformers *(string | ((program: ts.Program) => ts.CustomTransformers | undefined)) (default=undefined)*\n\nProvide custom transformers, TypeScript 2.4.1+. Example:\n\n```js\nconst styledComponentsTransformer = require('typescript-plugin-styled-components').default;\nconst keysTransformer = require('ts-transformer-keys/transformer').default;\n\n// ...\nrules: [\n    {\n        test: /\\.tsx?$/,\n        loader: 'awesome-typescript-loader',\n        options: {\n            // ... other loader's options\n            getCustomTransformers: program => ({\n                before: [\n                    styledComponentsTransformer(),\n                    keysTransformer(program)\n                ]\n            })\n        }\n    }\n]\n```\n\n## Compiler options\n\nYou can pass compiler options inside the loader query string or in a TS config file.\n","publish_time":1438840690360,"_cnpm_publish_time":1438840690360,"dist-tags":{"latest":"5.2.1","next":"4.0.0-0","prerelease":"4.0.0-1"}}