aboutsummaryrefslogtreecommitdiff
path: root/plugins/withMarkdownLoader.js
blob: c1e0ac693a9723d2443721a52b4ef193948c4c4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const pluginFactory = require('./pluginFactory');
const markedOptions = require('../utils/markedOptions');


const withMarkdownLoader = pluginFactory((config, _options) => {
    config.module.rules.push({
        test: /\.md$/,
        use: [
            {
                loader: 'html-loader',
                options: {
                    esModule: true
                }
            },
            {
                loader: 'markdown-loader',
                options: markedOptions
            }
        ]
    });
});

module.exports = withMarkdownLoader;