klei / gulp-inject

A javascript, stylesheet and webcomponent injection plugin for Gulp
MIT License
812 stars 93 forks source link

JS not injecting from certain sources, injecting fine for others. #167

Open abarganier opened 8 years ago

abarganier commented 8 years ago

I've been using this plugin for a while now and I love it. Unfortunately over the past month or so I've noticed some issues begin to pop up.

Case 1:

We have an angular application where we're injecting JS <script> tags and CSS <link> tags from various sources. Our directory structure looks something like...

Directory Structure:

|-app
  |-controllerName
    |-controller.js
    |-controller.html
|-assets
  |-css
    |-variousStyles.css
  |-plugins
    |-pluginName
      |-pluginName.js
|-bower_components
|-scripts
  |-app.js
  |-variousServices.js

Most of our libs are handled via bower. However, we have one library that we customized that we keep in assets/plugins/pluginName/. All of these except assets/plugins/pluginName/ inject into the index.html without issue. But that one plugin... It won't inject. Oddly enough, if we throw a pluginName.css into assets/plugins/pluginName/, it injects without issue. The problem is specific to .js files in the directory.

gulpfile.js (some tasks omitted that are irrelevant to this build process):

var gulp = require('gulp-help')(require('gulp'));
var bytediff = require('gulp-bytediff');
var browserSync = require('browser-sync');
var cdnizer = require("gulp-cdnizer");
var changed = require('gulp-changed');
var concat = require('gulp-concat');
var csso = require('gulp-cssnano');
var debug = require('gulp-debug');
var del = require('del');
var gutil = require('gulp-util');
var inject = require("gulp-inject");
var jshint = require('gulp-jshint');
var karma = require('karma').server;
var less = require('gulp-less');
var merge = require('merge-stream');
var minifyHtml = require("gulp-minify-html");
var ngAnnotate = require('gulp-ng-annotate');
var ngHtml2Js = require("gulp-ng-html2js");
var plumber = require('gulp-plumber');
var rename = require('gulp-rename');
var runSequence = require('run-sequence');
var confirm = require('gulp-confirm');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var streamqueue = require('streamqueue');
var stylish = require('jshint-stylish');
var uglify = require("gulp-uglify");
var vinylPaths = require('vinyl-paths');
var watch = require('gulp-watch');
var wrap = require("gulp-wrap");

/* require package.json and our build configuration. */
var pkg = require('./package.json');
var config = require('./gulpbuild.config.js');

/* Here we list the naming convention for our minified JS/CSS files. */
var prodFileName = pkg.name + '-' + pkg.version;

var prodOutputFiles = {
    js: prodFileName + '.min.js',
    css: prodFileName + '.css'
};

/* These are filenames that refer to the files output by the build-vendor-js and
 * build-vendor-css tasks. They're referenced in the call to gulp.src() in build-prod-index
 */
var prodVendorFiles = {
    js: 'bower_components.min.js',
    css: 'bower_components.css'
};

/* This task will compile any less/scss into css, and then concatenate the result with
* any existing .css and then output it to the build directory
*/
gulp.task('style', 'compiles less, scss, and css into a single file', function() {

    return streamqueue({objectMode:true},
                        gulp.src([].concat(config.appFiles.css)), // css
                        gulp.src([].concat(config.appFiles.scss)).pipe(sass().on('error', sass.logError)), // scss
                        gulp.src([].concat(config.appFiles.less)).pipe(less()) // less
                    )
                .pipe(concat(pkg.name + '-' + pkg.version + '.css'))
                .pipe(gulp.dest(config.buildDir + '/assets/css/'));
});

gulp.task('clean', 'cleans build dirs', function () {
    return gulp.src(config.buildDir)
        .pipe(vinylPaths(del));
});

/*
 * Does the appropriate copying of our files into the proper
 * build directory. `changed()` helps us only copy the changed files.
 */
gulp.task('copy', 'copies all relevant files to their proper location in /build during development', function() {

    var assets = gulp.src([].concat(config.appFiles.assets), {
            base: 'assets/'
        })
        .pipe(changed(config.buildDir + '/assets'))
        .pipe(gulp.dest(config.buildDir + '/assets'));

    var plugins = gulp.src([].concat(config.appFiles.plugins), {
            base: 'assets/'
        })
        .pipe(debug())
        .pipe(changed(config.buildDir + '/assets/plugins/**/*'))
        .pipe(gulp.dest(config.buildDir + '/assets'));

    var appJS = gulp.src(config.appFiles.js)
        .pipe(changed(config.buildDir + '/app'))
        .pipe(wrap('(function(){\n"use strict";\n<%= contents %>\n})();'))
        .pipe(gulp.dest(config.buildDir + '/app'));

    var appScripts = gulp.src(config.appFiles.scripts)
        .pipe(changed(config.buildDir + '/scripts'))
        .pipe(wrap('(function(){\n"use strict";\n<%= contents %>\n})();'))
        .pipe(gulp.dest(config.buildDir + '/scripts'));

    var vendorJS = gulp.src([].concat(config.bowerFiles.jsCdn, config.bowerFiles.jsLocal), { base: '.' })
        .pipe(changed(config.buildDir))
        .pipe(gulp.dest(config.buildDir));

    var vendorCSS = gulp.src([].concat(config.bowerFiles.cssCdn, config.bowerFiles.cssLocal), { base: '.' })
        .pipe(changed(config.buildDir))
        .pipe(gulp.dest(config.buildDir));

    var fonts = gulp.src(config.bowerFiles.fonts, { base: '.' })
        .pipe(changed(config.buildDir))
        .pipe(gulp.dest(config.buildDir));

    var rootItems = gulp.src(config.appFiles.rootItems)
        .pipe(changed(config.buildDir))
        .pipe(gulp.dest(config.buildDir));

    return merge([assets, plugins, appJS, vendorJS, vendorCSS, fonts, rootItems]);
});

/*
 * Compiles our index.html and injects <script> and <link> tags for our bower
 * libraries. CSS will be injected between the <!-- inject:css --><!-- endinject -->
 * comments in our index.html, and JS will be injected between the 
 * <!-- inject:js --><!-- endinject --> comments. To add libraries for injection, refer
 * to the comments at the top of the gulpbuild.config.js file.
 */
gulp.task('index', 'injects script and css files into our index.html file', function() {
    var target = gulp.src('index.html');
    var files = [].concat(
        config.bowerFiles.cssLocal,
        config.bowerFiles.cssCdn,
        'assets/css/' + pkg.name + '-' + pkg.version + '.css',
        config.appFiles.css,
        'assets/css/' + pkg.name + '-' + pkg.version + '.css',
        config.bowerFiles.jsCdn,
        config.bowerFiles.jsLocal,
        config.appFiles.js,
        config.appFiles.scripts,
        config.appFiles.plugins,
        'templates-app.js',
        'templates-common.js'
    );
    console.log(files);
    var sources = gulp.src(files, {
        read: false,
        cwd: config.buildDir,
        })
        .pipe(debug());

    /* inject the files, and output to the build directory */
    return target
        .pipe(inject(sources, { addRootSlash: false }))
        .pipe(gulp.dest(config.buildDir));
});

gulp.task('html2js', 'compiles .html files into javascript templates, injected into $templateCache', function() {
    var appTemplates = gulp.src(config.appFiles.ahtml)
        .pipe(plumber())
        .pipe(minifyHtml({
            empty: true,
            spare: true,
            quotes: true
        }))
        .pipe(ngHtml2Js({
            moduleName: 'templates-app'
        }))
        .pipe(concat('templates-app.js'))
        .pipe(uglify())
        .pipe(gulp.dest(config.buildDir));

    var commonTemplates = gulp.src(config.appFiles.chtml)
        .pipe(plumber())
        .pipe(minifyHtml({
            empty: true,
            spare: true,
            quotes: true
        }))
        .pipe(ngHtml2Js({
            moduleName: 'templates-common'
        }))
        .pipe(concat('templates-common.js'))
        .pipe(uglify())
        .pipe(gulp.dest(config.buildDir));

    return merge([appTemplates, commonTemplates]);
});

gulp.task('ngAnnotate', 'runs ngAnnotate on our code for proper `strictdi` conformity', function() {
    return gulp.src(config.buildDir + '/app/**/*.js')
        .pipe(plumber())
        .pipe(ngAnnotate({ add: true }))
        .pipe(gulp.dest(config.buildDir + '/app'));
});

/**
 * Setup our default task's sequence, when `$ gulp` is run.
 */
gulp.task('default', 'runs -> build, watch', function() {
    runSequence('build', 'watch');
});

/*
 * Setup our build task's sequence, when `$ gulp build` is run.
 */
gulp.task('build', 'runs -> clean, style, html2js, copy, ngAnnotate, index', function() {
    return runSequence('clean', 'style', 'html2js', 'copy', 'ngAnnotate', 'index');
});

Note we're logging the files array in the inject task to console, and then also printing out the result of passing files to gulp.src(). Here's that output...

Console output:

[12:01:27] Finished 'copy' after 367 ms
[12:01:27] Starting 'ngAnnotate'...
[12:01:27] Finished 'ngAnnotate' after 250 ms
[12:01:27] Starting 'index'...
[ 'bower_components/angular-toggle-switch/angular-toggle-switch.css',
  'bower_components/skylo/vendor/styles/skylo.css',
  'bower_components/angular-growl/build/angular-growl.min.css',
  'bower_components/ng-table/dist/ng-table.min.css',
  'bower_components/textAngular/dist/textAngular.css',
  'bower_components/ui-select/dist/select.min.css',
  'bower_components/ng-sortable/dist/ng-sortable.min.css',
  'bower_components/ng-sortable/dist/ng-sortable.style.min.css',
  'bower_components/bootstrap/dist/css/bootstrap.min.css',
  'bower_components/font-awesome/css/font-awesome.min.css',
  'assets/css/SRSv3_FrontEnd-1.0.0.css',
  'assets/css/styles.css',
  'assets/css/loaders.css',
  'assets/css/custom.css',
  'assets/css/SRSv3_FrontEnd-1.0.0.css',
  'bower_components/jquery/dist/jquery.min.js',
  'bower_components/angular/angular.js',
  'bower_components/underscore/underscore-min.js',
  'bower_components/bootstrap/dist/js/bootstrap.min.js',
  'bower_components/skylo/vendor/scripts/skylo.js',
  'bower_components/angular-toggle-switch/angular-toggle-switch.min.js',
  'bower_components/angular-growl/build/angular-growl.min.js',
  'bower_components/ng-file-upload/ng-file-upload.min.js',
  'bower_components/angular-ui-utils/ui-utils-ieshiv.min.js',
  'bower_components/angular-ui-utils/ui-utils.min.js',
  'bower_components/ui-select/dist/select.min.js',
  'bower_components/ng-table/dist/ng-table.min.js',
  'bower_components/textAngular/dist/textAngular.min.js',
  'bower_components/textAngular/dist/textAngular-rangy.min.js',
  'bower_components/textAngular/dist/textAngular-sanitize.min.js',
  'bower_components/angular-resource/angular-resource.min.js',
  'bower_components/angular-cookies/angular-cookies.min.js',
  'bower_components/angular-route/angular-route.min.js',
  'bower_components/angular-animate/angular-animate.min.js',
  'bower_components/angular-bootstrap/ui-bootstrap.js',
  'bower_components/angular-bootstrap/ui-bootstrap-tpls.js',
  'bower_components/moment/min/moment.min.js',
  'bower_components/bootbox.js/bootbox.js',
  'bower_components/enquire/dist/enquire.min.js',
  'bower_components/ngDraggable/ngDraggable.js',
  'bower_components/ng-sortable/dist/ng-sortable.min.js',
  'bower_components/angular-local-storage/dist/angular-local-storage.min.js',
  'app/**/customize.js',
  'app/**/*.js',
  '!app/**/*.spec.js',
  '!scripts/**/*.spec.js',
  '!assets/**/*.js',
  'scripts/*.js',
  'scripts/**/*.js',
  'assets/plugins/ng-signature-pad-master/dist/ng-signature-pad.min.js',
  'templates-app.js',
  'templates-common.js' ]
[12:01:27] gulp-debug: build\bower_components\angular-toggle-switch\angular-togg
le-switch.css
[12:01:27] gulp-debug: build\bower_components\skylo\vendor\styles\skylo.css
[12:01:27] gulp-debug: build\bower_components\angular-growl\build\angular-growl.
min.css
[12:01:27] gulp-debug: build\bower_components\ng-table\dist\ng-table.min.css
[12:01:27] gulp-debug: build\bower_components\textAngular\dist\textAngular.css
[12:01:27] gulp-debug: build\bower_components\ui-select\dist\select.min.css
[12:01:27] gulp-debug: build\bower_components\ng-sortable\dist\ng-sortable.min.c
ss
[12:01:27] gulp-debug: build\bower_components\ng-sortable\dist\ng-sortable.style
.min.css
[12:01:27] gulp-debug: build\bower_components\bootstrap\dist\css\bootstrap.min.c
ss
[12:01:27] gulp-debug: build\bower_components\font-awesome\css\font-awesome.min.
css
[12:01:27] gulp-debug: build\assets\css\SRSv3_FrontEnd-1.0.0.css
[12:01:27] gulp-debug: build\bower_components\jquery\dist\jquery.min.js
[12:01:27] gulp-debug: build\bower_components\angular\angular.js
[12:01:27] gulp-debug: build\bower_components\underscore\underscore-min.js
[12:01:27] gulp-debug: build\bower_components\bootstrap\dist\js\bootstrap.min.js

[12:01:27] gulp-debug: build\bower_components\skylo\vendor\scripts\skylo.js
[12:01:27] gulp-debug: build\bower_components\angular-toggle-switch\angular-togg
le-switch.min.js
[12:01:27] gulp-debug: build\bower_components\angular-growl\build\angular-growl.
min.js
[12:01:27] gulp-debug: build\bower_components\ng-file-upload\ng-file-upload.min.
js
[12:01:27] gulp-debug: build\bower_components\angular-ui-utils\ui-utils-ieshiv.m
in.js
[12:01:27] gulp-debug: build\bower_components\angular-ui-utils\ui-utils.min.js
[12:01:27] gulp-debug: build\bower_components\ui-select\dist\select.min.js
[12:01:27] gulp-debug: build\bower_components\ng-table\dist\ng-table.min.js
[12:01:27] gulp-debug: build\bower_components\textAngular\dist\textAngular.min.j
s
[12:01:27] gulp-debug: build\bower_components\textAngular\dist\textAngular-rangy
.min.js
[12:01:27] gulp-debug: build\bower_components\textAngular\dist\textAngular-sanit
ize.min.js
[12:01:27] gulp-debug: build\bower_components\angular-resource\angular-resource.
min.js
[12:01:27] gulp-debug: build\bower_components\angular-cookies\angular-cookies.mi
n.js
[12:01:27] gulp-debug: build\bower_components\angular-route\angular-route.min.js

[12:01:27] gulp-debug: build\bower_components\angular-animate\angular-animate.mi
n.js
[12:01:27] gulp-debug: build\bower_components\angular-bootstrap\ui-bootstrap.js
[12:01:27] gulp-debug: build\bower_components\angular-bootstrap\ui-bootstrap-tpl
s.js
[12:01:27] gulp-debug: build\bower_components\moment\min\moment.min.js
[12:01:27] gulp-debug: build\bower_components\bootbox.js\bootbox.js
[12:01:27] gulp-debug: build\bower_components\enquire\dist\enquire.min.js
[12:01:27] gulp-debug: build\bower_components\ngDraggable\ngDraggable.js
[12:01:27] gulp-debug: build\bower_components\ng-sortable\dist\ng-sortable.min.j
s
[12:01:27] gulp-debug: build\bower_components\angular-local-storage\dist\angular
-local-storage.min.js
[12:01:27] gulp-debug: build\app\customize\customize.js
[12:01:27] gulp-debug: build\app\app-packages\app-packages.js
[12:01:27] gulp-debug: build\app\changepassword\changepassword.js
[12:01:27] gulp-debug: build\app\companies\companies.js
[12:01:27] gulp-debug: build\app\customize\controller.build.js
[12:01:27] gulp-debug: build\app\customize\controller.dialog.confirmDelete.js
[12:01:27] gulp-debug: build\app\customize\controller.dialog.exitForm.js
[12:01:27] gulp-debug: build\app\customize\controller.dialog.manageField.js
[12:01:27] gulp-debug: build\app\customize\controller.render.js
[12:01:27] gulp-debug: build\app\customize\service.render.js
[12:01:27] gulp-debug: build\app\dashboard\dashboard.js
[12:01:27] gulp-debug: build\app\forgotpassword\forgotpassword.js
[12:01:27] gulp-debug: build\app\forgotusername\forgotusername.js
[12:01:27] gulp-debug: build\app\login\login.js
[12:01:27] gulp-debug: build\app\logs\logs.js
[12:01:27] gulp-debug: build\app\reports\reports.js
[12:01:27] gulp-debug: build\app\review_forms\review_forms.js
[12:01:27] gulp-debug: build\app\swmasteraccount\swmasteraccount.js
[12:01:27] gulp-debug: build\app\users\users.js
[12:01:27] gulp-debug: build\scripts\AccountService.js
[12:01:27] gulp-debug: build\scripts\angular-base64-upload.js
[12:01:27] gulp-debug: build\scripts\app.js
[12:01:27] gulp-debug: build\scripts\DropboxService.js
[12:01:27] gulp-debug: build\scripts\FlashAlertService.js
[12:01:27] gulp-debug: build\scripts\FormDirectives.js
[12:01:27] gulp-debug: build\scripts\Navigation.js
[12:01:27] gulp-debug: build\scripts\ReviewFormsService.js
[12:01:27] gulp-debug: build\scripts\Services.js
[12:01:27] gulp-debug: build\scripts\templates.js
[12:01:27] gulp-debug: build\scripts\ThemeDirectives.js
[12:01:27] gulp-debug: build\scripts\userManagement.js
[12:01:27] gulp-debug: build\templates-app.js
[12:01:27] gulp-debug: 70 items
[12:01:27] gulp-inject 70 files into index.html.
[12:01:27] Finished 'index' after 109 ms

Here's what the index looks like. index.html

<!DOCTYPE html>
<html lang="en">

<head>
    <!--Application Specific CSS Files -->
    <!-- inject:css -->
    <!-- endinject -->
</head>

<body class="" ng-app="themesApp" ng-controller="MainController" ng-class="{
              'focusedform': style_fullscreen,
              'collapse-leftbar': style_leftbarCollapsed && !style_leftbarShown,
              'show-leftbar': style_leftbarShown
            }" ng-cloak>
    <!--Application Specific Angular Code -->
    <!-- inject:js -->
    <!-- endinject -->
</body>
</html>

The file assets/plugins/ng-signature-pad-master/dist/ng-signature-pad.min.js is the culprit. You can see it's included in the files array, but it doesn't get pulled into the vinyl-stream. I can verify that the file is indeed copied over into build/assets/plugins/ng-signature-pad-master/dist/ in the copy task.

Any idea on what could be causing this?

Case 2:

Additionally, another project with a very similar directory structure has stopped injecting the templates-app.js file output by the html2js task. I'll post its gulpfile.js below. In this case it was working for quite some time, and then it stopped working out of the blue. I ran a build and it worked. When I ran the build task again, it no longer was injecting. It was working without issue for over a month prior to the problem arising, and the gulpfile.js was not touched. I'll post that project's gulpfile.js below as well. The index.html for this project is almost the same as that above.

gulpfile.js

var gulp = require('gulp');
var browserSync = require('browser-sync');
var cdnify = require('gulp-cdnizer');
var changed = require('gulp-changed');
var concat = require('gulp-concat');
var css = require('gulp-csso');
var debug = require('gulp-debug');
var del = require('del');
var html2Js = require('gulp-ng-html2js');
var inject = require('gulp-inject');
var maps = require('gulp-sourcemaps');
var merge = require('merge-stream');
var minifyHtml = require('gulp-minify-html');
var ngAnnotate = require('gulp-ng-annotate');
var rename = require('gulp-rename');
var runSequence = require('run-sequence');
var stream = require('streamqueue');
var ugligy = require('gulp-uglify');
var vinylPaths = require('vinyl-paths');
var watch = require('gulp-watch');
var wrap = require('gulp-wrap');

var packageJson = require('./package.json');
var gulpConfig = require('./gulpconfig.js');

gulp.task('style', function() {

    return gulp.src(gulpConfig.appFiles.css)
        .pipe(concat(packageJson.name + '-' + packageJson.version + '.css'))
        .pipe(gulp.dest(gulpConfig.buildDirectory + '/assets/css/'));
});

gulp.task('clean', function() {

    return gulp.src(gulpConfig.buildDirectory)
        .pipe(vinylPaths(del));
});

gulp.task('cleanProd', function() {
    return gulp.src(gulpConfig.prodDirectory)
        .pipe(vinylPaths(del));
});

gulp.task('copy', function() {

    var imgAssets = gulp.src(gulpConfig.appFiles.assets, { base: 'assets/'})
        .pipe(changed(gulpConfig.buildDirectory + '/assets'))
        .pipe(gulp.dest(gulpConfig.buildDirectory + '/assets'));

    var js = gulp.src(gulpConfig.appFiles.js)
        .pipe(changed(gulpConfig.buildDirectory + '/app'))
        .pipe(wrap('(function(){\n"use strict";\n<%= contents %>}\n)();'))
        .pipe(gulp.dest(gulpConfig.buildDirectory + '/app'));

    var scripts = gulp.src(gulpConfig.appFiles.scripts)
        .pipe(changed(gulpConfig.buildDirectory + '/scripts'))
        .pipe(wrap('(function(){\n"use strict";\n<%= contents %>}\n)();'))
        .pipe(gulp.dest(gulpConfig.buildDirectory + '/scripts'));

    var bowerJS = gulp.src(gulpConfig.bowerLibs.js, {base: '.'})
        .pipe(changed(gulpConfig.buildDirectory))
        .pipe(gulp.dest(gulpConfig.buildDirectory));

    var bowerCSS = gulp.src(gulpConfig.bowerLibs.css, {base: '.'})
        .pipe(changed(gulpConfig.buildDirectory))
        .pipe(gulp.dest(gulpConfig.buildDirectory));

    var fonts = gulp.src(gulpConfig.bowerLibs.fonts, {base: '.'})
        .pipe(changed(gulpConfig.buildDirectory))
        .pipe(gulp.dest(gulpConfig.buildDirectory));

    return merge([imgAssets, js, scripts, bowerJS, bowerCSS, fonts]);
});

gulp.task('annotate', function() {
    return gulp.src(gulpConfig.buildDirectory + '/app/**/*.js')
        .pipe(ngAnnotate({ add:true }))
        .pipe(gulp.dest(gulpConfig.buildDirectory + '/app'));
});

gulp.task('ngHtml2Js', function() {
    gulp.src(gulpConfig.appFiles.html)
        .pipe(minifyHtml({
            empty: true,
            spare: true,
            quotes: true
        }))
        .pipe(html2Js({
            moduleName: 'html-templates'
        }))
        .pipe(concat('html-templates.js'))
        .pipe(ugligy())
        .pipe(gulp.dest(gulpConfig.buildDirectory));
});

gulp.task('index', function() {
    var index = gulp.src('index.html');
    var filesToInject = [].concat(
        gulpConfig.bowerLibs.js,
        gulpConfig.appFiles.scripts,
        gulpConfig.appFiles.js,
        gulpConfig.bowerLibs.css,
        'assets/css/' + packageJson.name + '-' + packageJson.version + '.css',
        'html-templates.js'
    );
    var vinylStreamSource = gulp.src(filesToInject, {
        read: false,
        cwd: gulpConfig.buildDirectory
    });
    return index
        .pipe(inject(vinylStreamSource, { addRootSlash: false }))
        .pipe(gulp.dest(gulpConfig.buildDirectory));
});

gulp.task('watch', function() {
    browserSync({
       port: 5000,
       server: {
           baseDir: gulpConfig.buildDirectory
       }
    });
    gulp.watch([gulpConfig.appFiles.js, gulpConfig.appFiles.scripts, gulpConfig.appFiles.assets],
              function() { runSequence('copy', 'reload') });
    gulp.watch([gulpConfig.appFiles.html],
              function() { runSequence('ngHtml2Js', 'reload') });
    gulp.watch(['index.html'],
              function() { runSequence('index', 'reload') });
    gulp.watch([gulpConfig.appFiles.css],
              function() { runSequence('style', 'reload') });
});

gulp.task('reload', browserSync.reload);

gulp.task('default', function() {
    return runSequence('build', 'watch');
});

gulp.task('build', function() {
    return runSequence('clean', 'style', 'ngHtml2Js', 'copy', 'annotate', 'index');
});

This one puzzles me even more since the issue appeared out of the blue. Any ideas on this one as well? In the meantime we're putting static script tags in.

joakimbeng commented 8 years ago

I think I've found your problem... Here's a snippet from your output of console.log(files):

  '!assets/**/*.js', // <- this removes all *.js-files in the assets-dir
  'scripts/*.js',
  'scripts/**/*.js',
  'assets/plugins/ng-signature-pad-master/dist/ng-signature-pad.min.js', // <- this is a *.js file in the assets-dir

For me it seems that those patterns could be in conflict an the former (the negated one) wins in that case. But I'm not sure if it works like that, please verify by removing the !assets/**/*.js line and try again.

abarganier commented 8 years ago

Thanks for the reply, sorry for the late response I was on vacation. I will try this and get back to you, looks promising though!