Skip to content

Commit

Permalink
Fixed webpack config for storybook
Browse files Browse the repository at this point in the history
rewired の変更内容を storybook にも適用
  • Loading branch information
kotarella1110 committed Sep 11, 2018
1 parent 2fca2d2 commit 2928ade
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .storybook/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
const path = require('path');
process.argv.push('--scripts-version');
process.argv.push('react-scripts-ts');

const TSDocgenPlugin = require('react-docgen-typescript-webpack-plugin');
const rewires = require('../config-overrides').webpack;

module.exports = (baseConfig, env, config) => {
config.module.rules.push({
test: /\.(ts|tsx)$/,
loader: require.resolve('ts-loader')
loader: require.resolve('ts-loader'),
options: {},
});
config.plugins.push(new TSDocgenPlugin()); // optional
config.resolve.extensions.push('.ts', '.tsx');
return config;
return rewires(config);
};

0 comments on commit 2928ade

Please sign in to comment.