Uses decomment to remove comments from JSON, JavaScript, CSS, HTML, etc.
Installing
$ npm install grunt-decomment --save-dev
Example
module.exports = function (grunt) {
grunt.initConfig({
decomment: {
any: {
files: {
"output.js": "input.js",
"output.json": "input.json",
"output.html": "input.html"
}
},
text: {
options: {
type: 'text'
},
files: {
"output.css": "input.css",
"output.cpp": "input.cpp",
"output.h": "input.h"
}
},
html: {
options: {
type: 'html'
},
files: {
"output1.html": "input1.html",
"index.html": "index.html",
"./.tmp/index.html": "./.tmp/index.html"
}
},
withCwd: {
options: {
type: 'text'
},
src: ['./*.css', './**/*.css', '!./vendor/**/*'],
dest: './',
cwd: './dist/'
}
}
});
grunt.loadNpmTasks('grunt-decomment');
grunt.registerTask('default', ['decomment']);
};
Options
type
Changes the default call into decomment to one according to the value:
safe, ignore, space, trim
Options supported by decomment:
License
Copyright © 2016 Vitaly Tomilov;
Released under the MIT license.