grunt-inline

Brings externally referenced resources, such as js, css and images, into
a single file.

For exmample:

<link href="css/style.css?__inline=true" rel="stylesheet" />

is replaced with

<style>

/* contents of css/style.css */

</style>

```

Javascript references are brought inline, and images in the html

and css blocks are converted to base-64 data: urls.

By default, only urls marked with `__inline` are converted, however this

behavior can be overrided via the `tag:` option.

## Getting Started

This plugin requires Grunt `~0.4.1`

If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-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-inline --save-dev

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

grunt.loadNpmTasks('grunt-inline');

## The "grunt-inline" task

### Overview

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

grunt.initConfig({

inline: {

dist: {

src: 'src/index.html',

dest: 'dist/index.html'

}

}

})

### Options

#### dest

If dest is assigned, the the source file will be copied to the destination path. eg:

`src/index.html` will be processed and then copied to `dist/index.html`

Then, after the `inline` task is run, the original content in `index.html` will be replaced with

```

<p>I'm inline html</p>

<span>hello world!</span>

```

## 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](http://gruntjs.com/).

## Release History

* 2015-01-09 v0.3.3 bug fix: when processing files of a folder and then copy the processed content to another destination, the original files are changed unexpectedly, as mentioned in this issue [Support file globbing for input and output](https://github.com/chyingp/grunt-inline/issues/35)