Skip to content

Commit

Permalink
incorporate danielduan comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tsiq-swyx committed Apr 5, 2018
1 parent c8af430 commit 7d6e099
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/src/pages/configurations/custom-webpack-config/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ There are a few ways to do it:
You'll get _extend-mode_ by returning an object.

Let's say you want to add [SASS](http://sass-lang.com/) support to Storybook. This is how to do it.
Simply add the following content to a file called `webpack.config.js` in your Storybook config directory (`.storybook` by default ).
Add the following content to a file called `webpack.config.js` in your Storybook config directory (`.storybook` by default ).

```js
const path = require("path");
Expand Down Expand Up @@ -121,5 +121,5 @@ You may have an existing Webpack config for your project. So, you may need to co

But you don't need to. There are a few options:

* Simply import your main Webpack config into Storybook's `webpack.config.js` and use the loaders and plugins used in that.
* Import your main Webpack config into Storybook's `webpack.config.js` and use the loaders and plugins used in that.
* Create a new file with common Webpack options and use it in both inside the main Webpack config and inside Storybook's `webpack.config.js`.
6 changes: 3 additions & 3 deletions docs/src/pages/configurations/typescript-config/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ yarn add -D @storybook/addon-info react-docgen-typescript-webpack-plugin # optio
yarn add -D jest "@types/jest" ts-jest #testing
```

We have no opinion on whether you use `awesome-typescript-loader` or `ts-loader`, just configure either accordingly. You can even use `babel-loader` with a `ts-loader` configuration.

## Setting up Typescript to work with Storybook

We first have to use the [custom Webpack config in full control mode, extending default configs](https://storybook.js.org/configurations/custom-webpack-config/#full-control-mode--default):
We first have to use the [custom Webpack config in full control mode, extending default configs](/configurations/custom-webpack-config/#full-control-mode--default):

```js
// load the default config generator.
Expand Down Expand Up @@ -223,7 +225,5 @@ You will need to set up some scripts - these may help:

## Related Issues and Helpful Resources

* [Issue: Add proper typescript webpack setup in readme #1778](https://github.com/storybooks/storybook/issues/1778)
* [Issue: Addons info and Typescript props docgen? #1519](https://github.com/storybooks/storybook/issues/1519)
* [Storybook, React, TypeScript and Jest](https://medium.com/@mtiller/storybook-react-typescript-and-jest-c9059ea06fa7)
* [React, Storybook & TypeScript](http://www.joshschreuder.me/react-storybooks-with-typescript/)

0 comments on commit 7d6e099

Please sign in to comment.