{"name":"awesome-typescript-loader","version":"1.0.0","description":"Awesome TS loader for webpack","main":"dist.babel/entry.js","scripts":{"prepublish":"npm run test && grunt","pretest":"npm run build","test":"mocha dist.babel/test","watch":"npm run watch:ts && npm run watch:babel","watch:ts":"npm run build:ts -- --watch --diagnostics","watch:babel":"npm run build:babel -- --watch","prebuild":"npm run lint","build":"npm run build:ts && npm run build:babel","build:ts":"tsc -p src --pretty","build:babel":"babel dist -d dist.babel","lint":"tslint src/*.ts"},"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":{"babel-polyfill":"^6.1.19","colors":"^1.1.2","enhanced-resolve":"^0.9.1","es6-promisify":"^4.1.0","loader-utils":"^0.2.6","lodash":"^4.13.1","object-assign":"^4.1.0","parse-json":"^2.2.0","source-map-support":"^0.4.0","strip-bom":"^3.0.0","strip-json-comments":"^2.0.0","tsconfig":"^3.0.0"},"devDependencies":{"babel-cli":"^6.3.17","babel-core":"^6.7.4","babel-preset-es2015":"^6.1.2","babel-preset-es2015-node4":"^2.1.0","babel-preset-stage-2":"^6.1.2","bluebird":"^3.3.3","chai":"^3.5.0","git-hooks":"^1.0.2","grunt":"^1.0.1","grunt-bump":"^0.3.1","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-conventional-changelog":"^6.1.0","grunt-shell":"^1.1.2","load-grunt-tasks":"^3.5.0","mkdirp":"^0.5.1","mocha":"^2.3.4","ps-node":"^0.1.1","rimraf":"^2.5.0","sinon":"^1.17.4","temp":"^0.8.3","tslint":"3.11.0-dev.0","typescript":"1.9.0-dev.20160610-1.0","webpack":"2.1.0-beta.4"},"gitHead":"966796d1ac3faa14efc93f9d34bb06210f5a777b","_id":"awesome-typescript-loader@1.0.0","_shasum":"f6e5a181372d09767392d0960e47709516db3ef5","_from":".","_npmVersion":"3.9.3","_nodeVersion":"6.2.1","_npmUser":{"name":"panferov-s","email":"fnight.m@gmail.com"},"maintainers":[{"name":"panferov-s","email":"fnight.m@gmail.com"}],"dist":{"shasum":"f6e5a181372d09767392d0960e47709516db3ef5","tarball":"http://registry-npm.ywwl.com/awesome-typescript-loader/download/awesome-typescript-loader-1.0.0.tgz","integrity":"sha512-o/22SBGYme64ukvBZb1s/5rYvwUbuhB3FWB7I6G+yKd4eo1jyyYVEUH3mXpKQ94GSGa/9XMGz1OniME7U+mwWg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICpsGB1/DV9nWvz2ljWyTYEfc/XaJ6BFHuKAJm1QCz54AiEAux23ZF1IurOXO3NUcGSrS72jW8cfJH0QWqUF/uT9+ZY="}],"size":117766,"noattachment":false,"key":"/awesome-typescript-loader/-/awesome-typescript-loader-1.0.0.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/awesome-typescript-loader-1.0.0.tgz_1465555048987_0.49497195798903704"},"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":1465555051745,"_cnpm_publish_time":1465555051745,"dist-tags":{"latest":"5.2.1","next":"4.0.0-0","prerelease":"4.0.0-1"}}