What you are asking to do, from what I can say, is to consulate your js files into a single file, and then in your main.html you will have this
<script src="/pathLocation/allMyJSFiles.js"></script>
If my assumption is correct, then the answer will be to use one of the following two elements
GULP link or GRUNT link
I am using GULP .
You can use gulp on a case-by-case basis, which means calling gulp from the command line to execute gulp code, or using the clock to do this automatically when saving.
In addition, in order for gulp to work and including gulp files, you need to do what you need, I will only talk a little about what I use to get your answer.
In my gulp file, I would have something like this
var gulp = require('gulp'); var concat = require('gulp-concat'); ...maybe more.
Then I have file paths that I need to merge into a single file.
var onlyProductionJS = [ 'public/application.js', 'public/directives/**/*.js', 'public/controllers/**/*.js', 'public/factories/**/*.js', 'public/filters/**/*.js', 'public/services/**/*.js', 'public/routes.js' ];
and I use this information in the gulp task as shown below
gulp.task('makeOneFileToRuleThemAll', function(){ return gulp.src(onlyProductionJS) .pipe(concat('weHaveTheRing.js')) .pipe(gulp.dest('public/')); });
Then I run the task on my command line, calling
gulp makeOneFileToRuleThemAll
This call launches a gulp related task that uses 'gulp -concat' to collect all the files into one new file called 'weHaveTheRing.js' and creates this file in the target 'public /'
Then just add this new file to main.html
<script src="/pathLocation/weHaveTheRing.js"></script>
As for including all of your files in a single file, including your vendor's files, just make sure your vendor code works first. Most likely, it is better to leave them separately if you don’t have the right way to get your supplier’s code to download without any problems.
UPDATE
Here is my gulp task.
gulp.task('startTheWatchingEye', function () { gulp.watch(productionScripts, ['makeOneFileToRuleThemAll']); });
Then I start my server like this (yours may be different)
npm start // in a different terminal window I then type gulp startTheWatchfuleye
NOTE: you can use ANY movie or show the link you want! :)
Now just copy it, every time you make changes to the specified files, GULP will run your tasks.
If you want to say launch Karma for your test runner ...
add the following to your gulp file
var karma = require('karma').server; gulp.task('karma', function(done){ karma.start({ configFile: __dirname + '/karma.conf.js' }, done); });
Then add this karma task to your watch, which I outlined above, like this ...
gulp.task('startTheWatchingEye', function(){ gulp.watch(productionScripts, ['makeOneFileToRuleThemAll', 'karma']); });
also
Your specific settings may require a few more gulp modules. Usually you install gulp globally as well as each module. Then use them in your various projects. Just make sure your package.json project has the gulp modules you need in dev or something else.
There are various articles on whether to use gulp or Grunt. gulp was made after Grunt with a few add-ons that Grunt lacked. I don’t know if that’s enough for them. I like gulp a lot and I find it very useful with lots of documentation.
Good luck