I have a question regarding the practical use of RequireJS.
After learning about purely JavaScript-driven web pages, I have been enhancing individually rendered views (often provided by a PHP Framework) with AngularJS to add more functionality. However, managing dependencies has become increasingly complex with each <script>
tag added to different 'single pages', especially when there is a common main.js
file that includes libraries like jQuery and AngularJS itself.
It seems like this approach might not align with the philosophy of RequireJS which advocates for having a single main file that requires all dependencies.
For instance, consider an administration panel that utilizes various modules defined in AngularJS's dependencies.
Example:
scripts/
adminpanel/
panel.app.js
panel.filters.js
panel.directives.js
antoherModule/
andAntoherModule/
require.js
tl;dr
When extending individual pages with AngularJS instead of creating a fully javascript-driven web application, is it advisable to use RequireJS for AMD loading of modules used on these pages? And what would be the most effective way to do so?