![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
grunt-nghtml-uglify
Advanced tools
Grunt task to uglify HTML files mixed with AngularJS directives to make them valid HTML5
Grunt task for nghtml-uglify
If you haven't used grunt before, be sure to check out the Getting Started guide, as it explains how to create a gruntfile as well as install and use grunt plugins. Once you're familiar with that process, install this plugin with this command:
$ npm install --save-dev grunt-nghtml-uglify
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-nghtml-uglify');
Tip: the grunt-nghtml-uglify module makes it possible to keep the source code beatiful with custom angular directives, without worrying about HTML5 validation and old IE browser issues.
See the grunt docs on how to configure tasks and more advanced usage.
grunt.initConfig({
nghtmlUglify: {
options: {
directives: 'configs/directives.json'
},
dev: {
files: [{
expand: true,
cwd: 'tests/',
src: ['*.html'],
dest: 'tmp/',
ext: '.ng.html',
extDot: 'first'
}]
}
}
});
grunt.loadNpmTasks('grunt-nghtml-uglify');
grunt.registerTask('default', ['nghtmlUglify']);
Please see Gruntfile as an example usage
Type: String
Default: 'data-'
This config exist in case of a possible XHTML support in future release, you may safelyskip it if you are already using HTML5.
Type: String
Default: ''
Path to a json file which contains the angular and custom directives that are being used. In future, we may parse javascript and get the directives automatically. Yet for the time being adduming you use grunt-html-validation, you will know which directives to add to the directives.json
MIT © Ahmet Yeşil
FAQs
Grunt task to uglify HTML files mixed with AngularJS directives to make them valid HTML5
The npm package grunt-nghtml-uglify receives a total of 2 weekly downloads. As such, grunt-nghtml-uglify popularity was classified as not popular.
We found that grunt-nghtml-uglify demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.