zont / gulp-usemin

MIT License
338 stars 92 forks source link

Unable to minify scripts #160

Open James-ZHANG opened 8 years ago

James-ZHANG commented 8 years ago

For some reason, usemin fails to output any minified js files and the output html contains no script tag as well. It works for css minification, however... I've followed the doc and checked my gulpfile.js quite a few times and it shouldn't contain any trivial errors. Below is my block in html:

<!-- build:js scripts/main.js -->
    <script src="../bower_components/angular/angular.min.js">
    </script>
    <script src="scripts/app.js">
    </script>
<!-- endbuild -->

, and my gulp task:

gulp.task('usemin', ['jshint'], function() {
    return gulp.src('./app/menu.html')
        .pipe(usemin({
                    css: [minifycss(), rev()],
                    js: [uglify(), rev()]
        }))
        .pipe(gulp.dest('dist/'));
});
seleregb commented 8 years ago

what's your jshint task? this ?

gulp.task('jshint', function() { return gulp.src('app/scripts/**/*.js') .pipe(jshint()) .pipe(jshint.reporter(stylish)); });

or can you just paste the whole gulpfile.js