twigjs/twig.js

Added a twig extension

rolfcleveringa opened this issue · 1 comments

Hi,

Not really an issue, but I couldn't find it in the documentation.
How can I add Twig extensions, like MarkdownExtension ?

I use Webpack 5 and my config looks like this:

    module: {
        rules: [
            {
                test: /\.twig$/,
                use: [
                    'raw-loader',
                    {
                        loader: 'twig-html-loader',
                        options: {
                            data: {}
                        }
                    }
                ]
            },
        ],
    },
    plugins: [
        new HtmlWebpackPlugin({
            template: 'src/templates/index.twig'
        }),
    ],

I'm not sure how up-to-date this is but there is mention of a JavaScript markdown extension under Available Extensions in the docs.