{"bugs":{"url":"https://github.com/s-panferov/awesome-typescript-loader/issues"},"dist":{"shasum":"fde4fa9490ccd15a503dc0934292188c5b9d09d7","tarball":"https://registry.npmjs.org/awesome-typescript-loader/-/awesome-typescript-loader-4.0.0-0.tgz","fileCount":90,"integrity":"sha512-RGgeBSzIrm6dyvtYbIKfpEF/uBv07SjV4rbEHq+JTwsYepfj/LI6cwyNIa0ZvPxugyNFqkXTALdCAMN118zYGg==","signatures":[{"sig":"MEUCIF3szlg8bdLAa71E6wMrzjljIQjXUYHpiQ2yL0B4mTwbAiEAvPGqJ+raJm53+0KvbqpUDDNmoyfRZDHFadczCt0H14c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":419561},"main":"dist/entry.js","name":"awesome-typescript-loader","author":{"url":"http://panferov.me/","name":"Stanislav Panferov","email":"fnight.m@gmail.com"},"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\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    loaders: [\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            [\"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## Compiler options\n\nYou can pass compiler options inside the loader query string or in a TS config file.\n","gitHead":"99c6a6a168a6e59e86dfb3724455898513db913e","license":"MIT","scripts":{"lint":"tslint src/*.ts","test":"rimraf .test && mocha --timeout 30000 dist/__test__","build":"rimraf dist && tsc --pretty","watch":"npm run watch:ts","compile":"tsc --pretty","release":"standard-version","prebuild":"npm run lint","watch:ts":"npm run build:ts -- --watch --diagnostics","precommit":"lint-staged","prepublish":"npm run build","postinstall":"node node_modules/husky/bin/install.js || true"},"typings":"./dist/index.d.ts","_npmUser":{"name":"panferov-s","email":"fnight.m@gmail.com"},"homepage":"https://github.com/s-panferov/awesome-typescript-loader","keywords":["webpack","loader","webpack-loader","typescript"],"repository":{"url":"git+https://github.com/s-panferov/awesome-typescript-loader.git","type":"git"},"_npmVersion":"5.6.0","description":"Awesome TS loader for webpack","directories":{},"maintainers":[{"name":"panferov-s","email":"fnight.m@gmail.com"}],"_nodeVersion":"8.9.3","dependencies":{"chalk":"^2.3.1","lodash":"^4.17.4","mkdirp":"^0.5.1","micromatch":"^3.0.3","loader-utils":"^1.1.0","enhanced-resolve":"3.3.0","source-map-support":"^0.5.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.0.2","temp":"^0.8.3","husky":"^0.14.3","mocha":"^3.4.2","rimraf":"^2.6.1","tslint":"^5.4.3","ps-node":"^0.1.6","shelljs":"^0.7.8","webpack":"^3.11.0","bluebird":"^3.5.0","fs-extra":"^3.0.1","prettier":"^1.10.2","typescript":"^2.7.2","@types/chai":"^4.0.1","@types/node":"^8.0.5","lint-staged":"^7.0.0","@types/mocha":"^2.2.41","@types/sinon":"^2.3.2","empty-module":"0.0.2","@types/lodash":"^4.14.67","@types/shelljs":"^0.7.2","@types/webpack":"^3.0.1","standard-version":"^4.2.0","@types/micromatch":"^2.3.29"},"peerDependencies":{"typescript":"^2"},"_npmOperationalInternal":{"tmp":"tmp/awesome-typescript-loader_4.0.0-0_1519497689343_0.13969408961726693","host":"s3://npm-registry-packages"},"_id":"awesome-typescript-loader@4.0.0-0","version":"4.0.0-0"}