Skip to content

Instantly share code, notes, and snippets.

@evasconcelos
Created August 3, 2020 20:41
Show Gist options
  • Save evasconcelos/e5a7952ed0ce5f395c319fd0cae3e2ee to your computer and use it in GitHub Desktop.
Save evasconcelos/e5a7952ed0ce5f395c319fd0cae3e2ee to your computer and use it in GitHub Desktop.
Storybook 5 webpack config for typescript and postcss
const path = require('path');
module.exports = {
module: {
rules: [
{
test: /\.css$/,
use: [
{
loader: 'postcss-loader',
options: {
sourceMap: true,
config: {
path: './'
}
}
}
],
include: path.resolve(__dirname, '../')
},
{
test: /\.(ts|tsx)$/,
exclude: path.resolve(__dirname, '../node_modules/'),
use: [
{
loader: 'babel-loader',
options: {
presets: [['react-app', { flow: false, typescript: true }]]
}
},
{
loader: 'react-docgen-typescript-loader'
}
]
}
]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment