-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enable typescript in project #5
Conversation
webpackFinal: async config => { | ||
config.module.rules.push({ | ||
test: /\.(ts|tsx)$/, | ||
use: [ | ||
{ | ||
loader: require.resolve('ts-loader'), | ||
}, | ||
{ | ||
loader: require.resolve('react-docgen-typescript-loader'), | ||
}, | ||
], | ||
}); | ||
config.resolve.extensions.push('.ts', '.tsx'); | ||
return config; | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It turns out that the typescript-preset
actually has an error 🤦♀️. This manual step is required till the PR fix is merged in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reference, here is the link to the related github issue: storybookjs/presets#65
@@ -0,0 +1,8 @@ | |||
import * as React from "react"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm trying to figure out how to write import React from "react"
rather than import * as React from "react"
. If you know how, your contribution is welcomed 🙃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try #typescript
on the rangle slack. Maybe it is not loading types correctly from node_modules/@types
.
Looks great. |
a5e66a1
to
27edc0f
Compare
This PR enables us to use typescript in the design system