Fix is very quick and clean. InĀ gulp_tasks/build.js pass additional parameters to cssnano:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
return gulp.src(conf.path.tmp('/index.html')) .pipe(inject(partialsInjectFile, partialsInjectOptions)) .pipe(useref({}, lazypipe().pipe(sourcemaps.init, {loadMaps: true}))) .pipe(jsFilter) .pipe(ngAnnotate()) .pipe(uglify({preserveComments: uglifySaveLicense})).on('error', conf.errorHandler('Uglify')) .pipe(rev()) .pipe(jsFilter.restore) .pipe(cssFilter) // 8<------ HERE .pipe(cssnano({ reduceIdents: { keyframes: false }, discardUnused: { keyframes: false } })) // ------>8 HERE .pipe(rev()) .pipe(cssFilter.restore) .pipe(revReplace()) .pipe(sourcemaps.write('maps')) .pipe(htmlFilter) .pipe(htmlmin()) .pipe(htmlFilter.restore) .pipe(gulp.dest(conf.path.dist())); |