reactjs - Storybook'u TypeScript ile entegre et
TypeScript ile yazılmış çok basit bir React uygulamasını Storybook ile entegre etmeye çalışıyorum. Storybook konu listesinde birkaç sorunu takip etmeye çalıştım, ama en güncel bilginin ne olduğunu söyleyemiyorum. Storybook'u çalıştırmaya çalıştığımda aşağıdaki hatayı alıyorum:
ERROR in ./.storybook/config.js
Module not found: Error: Can't resolve '../stories' in
'react-mobx-mui-ts-seed/.storybook' @ ./.storybook/config.js 6:4-25
Biri bana yanlış yaptığım yeri gösterebilir mi lütfen? Tüm proje Github'da burada mevcut: https://github.com/archfirst/react-mobx-mui-ts-seed
İşte Storybook için webpack.config.js dosyam:
const path = require('path');
const SRC_PATH = path.join(__dirname, '../src');
module.exports = {
module: {
rules: [
{ test: /\.ts$/, loader: 'ts-loader', exclude: /node_modules/ },
{ test: /\.tsx$/, loader: 'ts-loader', exclude: /node_modules/ },
{
test: /\.(jpg|png|svg)$/,
loader: 'file-loader',
exclude: /node_modules/
},
{
test: /\.css$/,
use: [{ loader: 'style-loader' }, { loader: 'css-loader' }]
}
]
},
resolve: {
modules: [SRC_PATH, 'node_modules']
},
plugins: []
};
Şimdiden teşekkürler.
Düzenle: Şimdi bunu çalışır hale getirdim. Güncellenmiş çalışan kod için Github proje bağlantısını ziyaret edebilirsiniz.