Skip to content

Commit

Permalink
Merge pull request #9716 from sakito21/fix/docs-configurations-typesc…
Browse files Browse the repository at this point in the history
…ript-config

[Docs] configurations/TypeScript Config awesome-typescript-loader to ts-loader
  • Loading branch information
shilman authored Feb 4, 2020
2 parents e1677f0 + 1caf36d commit 8b28913
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions docs/src/pages/configurations/typescript-config/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,17 @@ You can learn more about Storybook presets [over here](../../presets/introductio

> If using TypeScript, some addons require features available in TS version 3.4+.
## Setting up TypeScript with awesome-typescript-loader
## Setting up TypeScript with ts-loader

### Dependencies you may need

```bash
yarn add -D typescript
yarn add -D awesome-typescript-loader
yarn add -D ts-loader
yarn add -D @storybook/addon-info react-docgen-typescript-loader # optional but recommended
yarn add -D jest "@types/jest" ts-jest #testing
```

We have had the best experience using `awesome-typescript-loader`, but other tutorials may use `ts-loader`, so be sure to configure accordingly. You can even use `babel-loader` with a `ts-loader` configuration.

### Setting up TypeScript to work with Storybook

We [configure storybook's webpack](/configurations/custom-webpack-config/#full-control-mode--default) by changing `.storybook/main.js`:
Expand All @@ -43,7 +41,7 @@ module.exports = {
test: /\.(ts|tsx)$/,
use: [
{
loader: require.resolve('awesome-typescript-loader'),
loader: require.resolve('ts-loader'),
},
// Optional
{
Expand Down

0 comments on commit 8b28913

Please sign in to comment.