Including All Scripts In Separate File
Solution 1:
browserify, webpack and requirejs are currently some popular bundling libraries.
Alternatively, you can simply concatenate all of your scripts into one file either manually using something like the cat
command in your terminal, or automatically, by using npm or a task runner like grunt or gulp then just include that file in your html. The benefit of using something like npm, gulp or grunt is that you can automatically watch your files for any changes, and when changes occur, it will concatenate all your various javascript files together for you.
Solution 2:
You may want to look into using HTML5 Imports using web components (http://webcomponents.org/) and polymer (https://www.polymer-project.org/1.0/), html imports and polyfill are native in chrome and then use simply use provided scripts for browser compatibility in IE and FF.
Post a Comment for "Including All Scripts In Separate File"