Registry / devops / grunt-class-id-minifier

grunt-class-id-minifier

JSON →
library0.3.2jsnpmunverified

Grunt plugin for minifying HTML class and id attributes in CSS and HTML files while generating JavaScript map files. Current stable version 0.3.2 (last release unknown). It is a legacy Grunt 0.4.x plugin that renames CSS class names and HTML ids to shorter forms, producing a mapping file for use in development. Key differentiator: targeted at front-end optimization for HTML/CSS with J_ prefix filtering. No longer actively maintained; deprecated in favor of modern webpack or PostCSS-based minification.

npm install grunt-class-id-minifier
INSTALL
IMPORT
SIG · GRUNT-CLASS-ID-MIN
G
grunt-class-id-minifier
devopsjavascriptv0.3.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

grunt-class-id-minifier task
grunt.loadNpmTasks('grunt-class-id-minifier');
const classIdMinifier = require('grunt-class-id-minifier');
Grunt plugin; not a direct import. Use loadNpmTasks in Gruntfile.

Basic Gruntfile configuration that minifies CSS class and HTML id attributes, filtering out names starting with J_.

module.exports = function(grunt) { grunt.initConfig({ 'class-id-minifier': { options: { jsMapFile: 'dist/map.js', jsMapDevFile: 'dist/map.dev.js', minifyFilter: function(name, type) { return !/^J_/.test(name); } }, files: [{ expand: true, cwd: 'src/', src: ['*.html', '*.css'], dest: 'dist/' }] } }); grunt.loadNpmTasks('grunt-class-id-minifier'); grunt.registerTask('default', ['class-id-minifier']); };
Debug
Known issues
deprecatedGrunt plugin is outdated; Grunt 0.4.x is no longer actively maintained. Consider using modern build tools like webpack or PostCSS.
fix
Migrate to PostCSS-based minification or use webpack with css-minimizer-webpack-plugin.
affects: >=0.0.0
breakingIn version 0.3.0, option 'scssMapFilter' was removed. Scripts using it will break.
fix
Remove scssMapFilter usage; functionality is no longer supported.
affects: >=0.3.0
gotchaOption 'minifyFilter' and 'jsMapFilter' are required; missing them may cause unexpected behavior.
fix
Define both filters in options even if just returning true.
affects: >=0.2.0
gotchaFiles must be .html and .css only; other types silently ignored.
fix
Ensure src patterns match *.html and *.css.
affects: >=0.0.0
Errors
Common errors & fixes
Warning: Task "class-id-minifier" not found.
Missing grunt.loadNpmTasks('grunt-class-id-minifier'); or plugin not installed.
fix
Run npm install grunt-class-id-minifier --save-dev and add loadNpmTasks in Gruntfile.
TypeError: Cannot read property 'jsMapFile' of undefined
Options object not fully defined; missing jsMapFile and jsMapDevFile.
fix
Ensure options include both jsMapFile and jsMapDevFile string paths.
Warning: Path must be a string. Received undefined
Missing options.jsMapFile or options.jsMapDevFile value.
fix
Set jsMapFile and jsMapDevFile to valid file paths.
Upgrade
Version history
0.3.2latest on npm
Audit
Dependencies
gruntrequiredpeer dependency; Grunt ~0.4.1 required
Agent activity
4 hits · last 30 days
node
4
Resources
grunt-class-id-minifier — npm install grunt-class-id-minifier · libregistry