assetgraph/assetgraph-builder

bundle=null (bootstrapper script replacement / alternative)

gustavnikolaj opened this issue · 3 comments

https://github.com/assetgraph/assetgraph-builder/blob/master/lib/transforms/buildProduction.js#L99

<script id="bootstrapper">console.log('this is development!');</script>

buildProduction removes script tags with id "bootstrapper". It works even with multiple script tags with that id. But multiple ids... :-(

<script bundle="development">console.log('this is development!');</script>
<script bundle="development">console.log('this is development!');</script>
<script bundle="development">console.log('this is development!');</script>
<script bundle="development">console.log('this is development!');</script>
<script bundle="development">console.log('this is development!');</script>

Instead, we should add a special bundle name that would be stripped when running buildProduction.

Good idea!

This is probably less relevant now after the integration work done with SystemJS and Webpack. It's been a while since I have seen the id="bootstrapper"-stuff anywhere, so I guess we might want to just close this suggestion :-)

Yeah, I agree. Those bundlers have their own features to strip out stuff like this. Let's not invent anything new unless it turns out there's a real demand for it.