Search code examples
javascriptgobuildweb-component

Go lang builder / task runner


I'm creating a little SPA framework (might be a full-feature framework). Frontend is based on native javascript (including ES6 features and web-components). Backend is written in Go.

Here is a list of my needs, that I'd like to do automatically:

  1. Minify my javascript files

  2. Transpile ES6 code to ES5 (with something like babel.js)

  3. Polyfill my web-components

Is there a way to achieve this without using node.js? Are there already go packages that can make those 3 things happen, with a "simple" grunt/gulp-like way?

I would like to avoid installing node.js, npm, bower... etc. In my (not very classified) oppinion, using those node.js tools makes my application a mess adding a lot of unnecessery overhead to my application folder and makes my framework dependant on a lot of stuff (that application programmer has to learn, understand and know how to use).

Thanks for any tips/oppinions.


Solution

  • If you're doing a SPA you should just stick with gulp and others. You'll probably end up using npm stuff like browserify, autoprefix, etc, and you'll basically end up reinventing the wheel with your own asset pipeline.

    With that said I've seen a couple, but none of them looked very mature last time I looked: https://github.com/jbowens/assets

    https://github.com/shaoshing/train

    and you're going to need npm installed to use them regardless.