
Ask HN: Is asset building as a service (ABaaS) a good idea? - tboyd47
I have this idea which I think is a killer, revolutionary, amazing idea but not sure if I&#x27;m right or just insane. Create a service that accepts a list of Javascript dependencies (from either NPM or GitHub), minifies them, combines them, and returns them to you in one file, in a RESTful API. Like this:<p>POST https:&#x2F;&#x2F;assetbuildservice.com&#x2F;assets<p>assets[]=github.com&#x2F;foobar&#x2F;package1&amp;assets[]=github.com&#x2F;bazquz&#x2F;package2<p>302 Redirect<p>Location: https:&#x2F;&#x2F;assetbuildservice.com&#x2F;assets&#x2F;da39a3ee5e6b4b0d325<p>GET https:&#x2F;&#x2F;assetbuildservice.com&#x2F;assets&#x2F;da39a3ee5e6b4b0d325?prod=1<p>200 OK<p>&#x2F;* Ref: https:&#x2F;&#x2F;assetbuildservice.com&#x2F;assets&#x2F;da39a3ee5e6b4b0d325
 * AssetBuildService.com built your assets! *&#x2F;
(function(a,b,c){d,e,f=0,0,1,...<p>The ABaaS would know how to make RequireJS play nice with AMD&#x2F;CommonJS in one project, and other JS projects that don&#x27;t use a requiring system. But that&#x27;s it. It doesn&#x27;t know how to transpile other languages to JS or do anything fancy with dependency trees -- it just creates a flat file that combines every dependency. It&#x27;s too dumb to figure out what order they go in too, so you&#x27;d have to experiment with that in your API calls. It could be an open source library that&#x27;s also hosted on a community-funded server.<p>What do you think? Useful or useless?
======
riebschlager
Clever idea! My current workflow for doing this same job is just using Bower
to manage the dependencies and a Gulp script to concat them. I'd be a little
worried about moving all my dependencies "to the cloud" like this.

But loads of people use sites like CDNJS, so I can definitely see it being
used. I'm not sure I'd want to be paying the hosting bills if it takes off
though :)

~~~
tboyd47
Thanks, that's encouraging! All I want a service for is building assets, not
hosting them, so there are easy ways to secure it from that angle: making the
build URLs expire after 60 seconds, making users authenticate to access them,
etc.

