Created
June 12, 2018 10:32
-
-
Save hco/75e3daf899ed988dfb2ca6c83df4ba82 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import '@storybook/addon-actions/register'; | |
import '@storybook/addon-links/register'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { configure } from '@storybook/react'; | |
// automatically import all files ending in *.stories.js | |
const req = require.context('../src', true, /.stories.(jsx?|tsx)$/); | |
function loadStories() { | |
req.keys().forEach((filename) => req(filename)); | |
} | |
configure(loadStories, module); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// load the default config generator. | |
const genDefaultConfig = require('@storybook/react/dist/server/config/defaults/webpack.config.js'); | |
module.exports = (baseConfig, env) => { | |
const config = genDefaultConfig(baseConfig, env); | |
// Extend it as you need. | |
// For example, add typescript loader: | |
config.module.rules.push({ | |
test: /\.(ts|tsx)$/, | |
loader: require.resolve('awesome-typescript-loader') | |
}); | |
config.resolve.extensions.push('.ts', '.tsx'); | |
return config; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment