fix(storybook): add support for .ts extension in storybook webpack configuration template (#2270)

can import from .ts files in .stories.tsx

ISSUES CLOSED: #2259
This commit is contained in:
leota 2020-01-06 19:46:45 +00:00 committed by Jack Hsu
parent 082529fdc0
commit 0ab2fc5176

View File

@ -4,6 +4,7 @@ module.exports = async ({ config, mode }) => {
config = await rootWebpackConfig({ config, mode });
<% if(uiFramework === '@storybook/react') { %>
config.resolve.extensions.push('.tsx');
config.resolve.extensions.push('.ts');
config.module.rules.push({
test: /\.(ts|tsx)$/,
loader: require.resolve('babel-loader'),