For quite some time, I have been on the search for a solution that can assist me in automating the process of renaming/minifying class names in HTML, JS, CSS files simultaneously throughout my entire project using gulp.
While there are many solutions available for either css or js individually, I came across gulp-minify-css-names which claims to work for all 3 types of source files. However, despite installing it and setting up a gulp task similar to the example provided on the npm site, I have been unable to get it to function properly.
Instead of producing modified css files, it simply outputs the same content (similarly for html and js).
Here is the code snippet of the task:
var gulp = require('gulp');
var gulpMinifyCssNames = require('gulp-minify-css-names');
gulp.task('minify-css-names', function() {
return gulp.src(['src/*.css'])
.pipe(gulpMinifyCssNames())
.pipe(gulp.dest('build'))
});
You can find the project page at - https://www.npmjs.com/package/gulp-minify-css-names
What could be causing it to not work as expected?
Upon inspecting the source code of gulp-minify-css-names in my node_modules folder, I noticed that it is surprisingly small in size: only 78 lines total