Each time I add a new HTML file to my website, I find myself repeating the process of including various CSS and JavaScript files:
<!-- Source for .css style rules -->
<link rel="stylesheet" type="text/css" href="/Hexdra/assets/css/style.css" />
<link type="text/css" href="/Hexdra/assets/bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet" />
<!-- JavaScript for using a custom file for resources. -->
<script src="/Hexdra/assets/scripts/angular.js"></script>
<script src="/Hexdra/assets/scripts/modernizr.custom.05819.js"></script>
<script src="/Hexdra/assets/scripts/siteScript.js"></script>
<!-- Angular Apps-->
<script type="text/javascript" src="/Hexdra/app/tank.js"></script>
<script type="text/javascript" src="/Hexdra/app/form.js"></script>
While this method is functional, it feels cumbersome. I'm aware of tools like require.js
for managing JavaScript files, but I'm struggling to find a similar solution for organizing CSS files.
What I envision is a more streamlined approach where I can reference a single file that then automatically imports all necessary CSS and JS resources. This would save time and make maintenance much simpler.
For example, when dealing with multiple bootstrap
files, it becomes clear that there must be a better way to handle these dependencies without manually loading each one.
If you have any insights or suggestions on how I can achieve this consolidated resource management system, please share your knowledge! I may not have all the terminology down yet, but I'm eager to learn and improve my workflow.