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')
|
2018-03-26 23:56:20 +03:00
|
|
|
})
|
|
|
|
|
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,
|
|
|
|
{
|
2019-03-06 09:10:06 +03:00
|
|
|
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: [
|
2018-03-26 23:56:20 +03:00
|
|
|
'style-loader',
|
|
|
|
'css-loader',
|
2017-10-10 01:44:56 +03:00
|
|
|
{
|
2018-03-26 23:56:20 +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
|
|
|
}
|