mirror of
https://github.com/primer/css.git
synced 2024-11-28 22:01:43 +03:00
44 lines
855 B
JavaScript
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
|
|
}
|