0.1.2 • Published 6 years ago

grunt-html-trim v0.1.2

Weekly downloads
19
License
MIT
Repository
github
Last release
6 years ago

grunt-html-trim

Greenkeeper badge

NPM version Build Status dependencies Status devDependencies Status

Trim HTML files

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, you may install this plugin with this command:

npm install grunt-html-trim --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-html-trim');

The "html_trim" task

Overview

In your project's Gruntfile, add a section named html_trim to the data object passed into grunt.initConfig().

grunt.initConfig({
  html_trim: {
    options: {
      // Task-specific options go here.
    }
  },
});

Options

No options for this plugin.

Usage Examples

Single File

In this example, html_trim will trim single file app/index.html and save output to dist/index.html.

grunt.initConfig({
  html_trim: {
    files: {
      'dist/index.html': 'app/index.html'
    }
  },
});

Multiple Files

In this example, html_trim will trim all *.html files include subdirectories under app/ and save output to dist/ directory.

grunt.initConfig({
  html_trim: {
    files: [
      {
        expand: true,
        cwd: 'app/',
        src: "**/*.html",
        dest: "dist/"
      }
    ]
  },
});

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

License

MIT