1
1
mirror of https://github.com/primer/css.git synced 2024-12-15 07:23:54 +03:00
css/.storybook/webpack.config.js
2019-03-05 22:07:53 -08:00

47 lines
932 B
JavaScript

const {resolve} = require('path')
const sourcePath = resolve(__dirname, '../src')
module.exports = ({config}) => {
const babel = config.module.rules.find(rule => {
return rule.test.test('test.js')
}).use[0]
config.module.rules = config.module.rules.filter(rule => {
return !rule.test.test('test.md')
})
config.module.rules.push(
{
test: /\.md$/,
include: sourcePath,
loaders: [
babel,
{
loader: require.resolve('./lib/storiesFromMarkdown'),
options: {
sourcePath
}
}
]
},
{
test: /\.scss$/,
include: sourcePath,
loaders: [
'style-loader',
'css-loader',
{
loader: 'postcss-loader',
options: {
config: {
path: require.resolve('../postcss.config.js')
}
}
}
]
}
)
return config
}