Skip to content

Commit

Permalink
Add TS support to official storybook.
Browse files Browse the repository at this point in the history
It would be better to use the preset here. cc @shilman / #5333
  • Loading branch information
Tom Coleman committed Jan 24, 2019
1 parent 6d57900 commit 28f3d27
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
1 change: 1 addition & 0 deletions examples/official-storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"react": "^16.7.0",
"react-dom": "^16.7.0",
"storybook-chromatic": "^1.2.4",
"ts-loader": "^5.3.3",
"uuid": "^3.3.2",
"webpack": "^4.29.0"
}
Expand Down
12 changes: 12 additions & 0 deletions examples/official-storybook/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ module.exports = async ({ config }) => ({
path.resolve(__dirname, '../../lib/components/src'),
],
},
{
test: /\.tsx?$/,
use: [
{
loader: require.resolve('ts-loader'),
},
],
},
],
},
plugins: [
Expand All @@ -36,4 +44,8 @@ module.exports = async ({ config }) => ({
// See https://github.com/graphql/graphql-language-service/issues/111#issuecomment-306723400
new ContextReplacementPlugin(/graphql-language-service-interface[/\\]dist/, /\.js$/),
],
resolve: {
...config.resolve,
extensions: [...(config.resolve.extensions || []), '.ts', '.tsx'],
},
});
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9932,11 +9932,11 @@ graphql-request@^1.5.0:
dependencies:
cross-fetch "2.2.2"

graphql@^0.13.2, graphql@^14.1.1:
version "0.13.2"
resolved "https://registry.yarnpkg.com/graphql/-/graphql-0.13.2.tgz#4c740ae3c222823e7004096f832e7b93b2108270"
graphql@^14.1.1:
version "14.1.1"
resolved "https://registry.yarnpkg.com/graphql/-/graphql-14.1.1.tgz#d5d77df4b19ef41538d7215d1e7a28834619fac0"
dependencies:
iterall "^1.2.1"
iterall "^1.2.2"

grizzly@^3.0.3:
version "3.0.4"
Expand Down Expand Up @@ -11417,7 +11417,7 @@ istextorbinary@2.1.0:
editions "^1.1.1"
textextensions "1 || 2"

iterall@^1.2.1:
iterall@^1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.2.2.tgz#92d70deb8028e0c39ff3164fdbf4d8b088130cd7"

Expand Down Expand Up @@ -20209,7 +20209,7 @@ ts-jest@~23.1.3:
json5 "^0.5.0"
lodash "^4.17.10"

ts-loader@^5.3.2:
ts-loader@^5.3.2, ts-loader@^5.3.3:
version "5.3.3"
resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-5.3.3.tgz#8b4af042e773132d86b3c99ef0acf3b4d325f473"
dependencies:
Expand Down

0 comments on commit 28f3d27

Please sign in to comment.