I may be missing something obvious, but I can't seem to be able to create a Webpack 4 loader as a simple function that can take options
:
rules: [{
test: /\.csv$/,
loader: function() {
// ...
},
options: {
// ...
}
}]
I dare not assume Webpack is so obstinate about loaders having to be npm packages, but I'm struggling to find an example where using a simple function as a loader works as intended.
Can someone help we with the most basic example of how to get something like this to work?
P.S. in the example config above, the function is imported from another file, just added it inline for clarity.