1
1
mirror of https://github.com/primer/css.git synced 2024-12-13 16:15:44 +03:00
css/.storybook/webpack.config.js

44 lines
855 B
JavaScript
Raw Normal View History

2019-03-06 08:43:02 +03:00
const {resolve} = require('path')
2019-03-08 01:41:36 +03:00
const pagesPath = resolve(__dirname, '../pages/css')
2017-08-18 02:25:33 +03:00
2019-03-06 09:07:53 +03:00
module.exports = ({config}) => {
2019-03-08 01:41:36 +03:00
const babel = config.module.rules[0].use[0]
2017-08-16 21:28:16 +03:00
2019-03-06 08:43:02 +03:00
config.module.rules = config.module.rules.filter(rule => {
return !rule.test.test('test.md')
})
2019-03-06 08:43:02 +03:00
config.module.rules.push(
{
test: /\.md$/,
2019-03-08 01:41:36 +03:00
include: pagesPath,
2019-03-06 08:43:02 +03:00
loaders: [
babel,
{
loader: require.resolve('./story-loader'),
2019-03-06 08:43:02 +03:00
options: {
2019-03-08 01:41:36 +03:00
sourcePath: pagesPath
2019-03-06 08:43:02 +03:00
}
}
]
},
2017-10-10 01:44:56 +03:00
{
test: /\.scss$/,
loaders: [
'style-loader',
'css-loader',
2017-10-10 01:44:56 +03:00
{
loader: 'postcss-loader',
2017-10-10 01:44:56 +03:00
options: {
config: {
2019-03-06 08:43:02 +03:00
path: require.resolve('../postcss.config.js')
}
2017-10-10 01:44:56 +03:00
}
2019-03-06 08:43:02 +03:00
}
]
2017-10-10 01:44:56 +03:00
}
)
return config
2017-08-16 21:28:16 +03:00
}