Skip to content

gijswijs/simple-nunjucks-loader-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reproducing issue #81 with simple-nunjucks-loader

If I follow the documentation for simple-nunjucks-loader and use the Filters option to load a filter:

webpack.config.js

module.exports = {
    module: {
        rules: [
            {
                test: /\.njk$/,
                use: [{
                    loader: 'simple-nunjucks-loader',
                    options: {
                        filters: {
                            filter: path.join(__dirname, 'filter.js')
                        }
                    }
                }]
            }
        ]
    }
};

filter.js

export default function filter(val, param) {
    return `${val + param}`;
}

error

 [...]\filter.js:1
    (function (exports, require, module, __filename, __dirname) { export default function filter(val, param) {
                                                                  ^^^^^^

    SyntaxError: Unexpected token export

This repo is meant to reproduce that issue, to help in fixing it.

About

Repo to showcase issue with simple-nunjucks-loader: https://github.com/ogonkov/nunjucks-loader/issues/81

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published