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:
parent
082529fdc0
commit
0ab2fc5176
@ -4,6 +4,7 @@ module.exports = async ({ config, mode }) => {
|
|||||||
config = await rootWebpackConfig({ config, mode });
|
config = await rootWebpackConfig({ config, mode });
|
||||||
<% if(uiFramework === '@storybook/react') { %>
|
<% if(uiFramework === '@storybook/react') { %>
|
||||||
config.resolve.extensions.push('.tsx');
|
config.resolve.extensions.push('.tsx');
|
||||||
|
config.resolve.extensions.push('.ts');
|
||||||
config.module.rules.push({
|
config.module.rules.push({
|
||||||
test: /\.(ts|tsx)$/,
|
test: /\.(ts|tsx)$/,
|
||||||
loader: require.resolve('babel-loader'),
|
loader: require.resolve('babel-loader'),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user