New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

grunt-nghtml-uglify

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-nghtml-uglify

Grunt task to uglify HTML files mixed with AngularJS directives to make them valid HTML5

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

grunt-nghtml-uglify Build Status

Grunt task for nghtml-uglify

  • Issues with the output should be reported to issue tracker.

Getting Started

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.

Documentation

See the grunt docs on how to configure tasks and more advanced usage.

Example with custom config and rules

 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']);

Examples

Please see Gruntfile as an example usage

Options

prefix

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.

directives

Type: String Default: ''

  • Note that you should provide one, see an example

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

License

MIT © Ahmet Yeşil

Keywords

FAQs

Package last updated on 20 Apr 2014

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc