Has anyone made a pipe/function that puts your javascript through webpack?

Hey all - I currently generate my game (bulletz.io) and my personal site with hugo.

Currently I transpile my javascript using babel but I need to spawn multiple processes and my whole asset pipeline is a bit annoying.

Has anyone come up with a nice hugo-ey way to do this?

I’m thinking something along the lines of…

{{$js = (resources.Get "js/app.js") | (webpack $opts)}}
<script src={{$js.Permalink}}></script>

has anyone made something like this?

No, but people are thinking about it:

Though it says there that Hugo’s pipe is using babel-cli if that helps you?

1 Like