From 85ff27b3d99365a84040d4a89c0cd08ede2896b5 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Tue, 18 Jun 2019 22:54:43 -0700 Subject: [PATCH] Update documentation - add tsc, ttypescript sections - add TOC --- README.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/README.md b/README.md index 3aa4db3..35e6afd 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,18 @@ The following command adds the packages to the project as a development-time dep
yarn add typescript-plugin-styled-components --dev
+# Documentation + +- [Integration with `Webpack`](#Integration-with-Webpack) + - [`awesome-typescript-loader`](#awesome-typescript-loader) + - [`ts-loader`](#ts-loader) + - [Forked process configuration](#Forked-process-configuration) +- [TypeScript compiler (CLI)](#TypeScript-compiler-CLI) +- [`ttypescript` compiler](#ttypescript-compiler) +- [API](#API) + - [`createTransformer`](#createTransformer) + - [`Options`](#Options) +- [Notes](#Notes) # Integration with `Webpack` @@ -130,6 +142,33 @@ options: { } ``` +# TypeScript compiler (CLI) + +TypeScript command line compiler tool (`tcs`) does not support using of pluggable modules and transformers. +For that reason there are other tools created that do support pluggable transformers. See [`ttypescript` compiler](#ttypescript-compiler) section. + +# `ttypescript` compiler + +The [`ttypescript` compiler](https://github.com/cevek/ttypescript) is a CLI tool that allows to use TypeScript compiler with pluggable transformers. +To use the transformer with that tool you can configure it by updating `tsconfig.json` the following way: + +```json +{ + "compilerOptions": { + "plugins": [ + { + "transform": "typescript-plugin-styled-components", + "type": "config", + + // other typescript-plugin-styled-components options can be added here + "minify": true, + "ssr": true + } + ] + } +} +``` + # API ## `createTransformer`