I have an index.html file. I want to specify build pragmas in this file, so I can include my dev stuff when developing and specify production at build time.
Something like this:
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
//>>excludeStart("devEntry", pragmas.build);
<script src="bower_components/requirejs/require.js" data-main="scripts/baseRequireConfig.js"></script>
//>>excludeEnd("devEntry", pragmas.build);
//>>excludeStart("prodEntry", pragmas.build);
<!--
//>>excludeEnd("prodEntry", pragmas.build);
<script src="require.js" data-main="productionRequireConfig.js"></script>
//>>excludeStart("prodEntry", pragmas.build);
-->
//>>excludeEnd("prodEntry", pragmas.build);
</body>
</html>
Only using HTML pragmas rather than r.js ones. What are some options for this? node.js plugin? Some bash thing? make
?
I ended up using sed
to change the text
cat index.html |\
sed s,bower_components/requirejs/require.js,require.js,g |\
sed s,scripts/baseRequireConfig.js,productionRequireConfig.js,g \
> build/index.html
Works for my current scale, but I wouldn't push it too far.