1
1
mirror of https://github.com/primer/css.git synced 2024-12-02 07:53:06 +03:00
css/.storybook/webpack.config.js
2019-03-07 14:41:36 -08:00

44 lines
855 B
JavaScript

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