Gulp usemin exclude files

420 Views Asked by At

Let's have index.html

<!-- build:js js/lib.js -->
<script src="../lib/angular-min.js"></script>
<script src="../lib/angular-animate-min.js"></script>
<!-- endbuild -->

<!-- build:js1 js/app.js -->
<script src="js/app.js"></script>
<script src="js/controllers/thing-controller.js"></script>
<script src="js/models/thing-model.js"></script>
<script src="js/views/thing-view.js"></script>
<!-- endbuild -->

On the output we will have 2 files in js directory: lib.js and app.js

For usemin code from this files I'm using this task:

return gulp.src(config.src.html.index)
    .pipe(usemin({
        css: [rev],
        html: [function () {
            return minifyHtml({empty: true});
        }],
        js: [ngAnnotate, uglify, rev],
        inlinejs: [uglify],
        inlinecss: [minifyCss, 'concat']
    }))
    .pipe(gulp.dest(config.build.root));

This task also runs ngAnnotate, uglify tasks for lib.js it takes a long time to make all this thigs working. I need to runn only these tasks for all files which will be in app.js file.

How to exclude library files from this addtional tasks ?

0

There are 0 best solutions below