mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-04 21:41:21 +08:00
24 lines
539 B
JavaScript
24 lines
539 B
JavaScript
const path = require('path');
|
|
|
|
module.exports = (baseConfig) => {
|
|
debugger;
|
|
const originalTsRule = baseConfig.module.rules.find(rule => rule.test.test('text.ts'));
|
|
|
|
if (originalTsRule) {
|
|
originalTsRule.exclude = [/\.stories\.tsx?$/];
|
|
}
|
|
|
|
baseConfig.module.rules.push({
|
|
test: [
|
|
/\.stories\.tsx?$/,
|
|
/index\.ts$/
|
|
],
|
|
loaders: [ ...originalTsRule.loaders, require.resolve('@storybook/addon-storysource/loader') ],
|
|
include: [
|
|
path.resolve(__dirname, '../src')
|
|
],
|
|
});
|
|
|
|
return baseConfig;
|
|
};
|