inline-data

Convert resource references to data URIs.

For each matched file convert resources to inline data: URIs according to the assigned rules.

Rules are objects with the following fields:

The test field is required and must be a valid regular expression. By default the encode flag is true and resources are base64 encoded however sometimes it may be more efficient (for svg images with gzip compression) to not base64 encode in which case set the encode field to false.

When the encode rule property is disabled the content is escaped using the encodeURIComponent function.

The mime type for referenced resources is resolved automatically.

new InlineData(context, options)

Create an InlineData plugin.

InlineData.prototype.before()

Initialize the list of matched resources used in the after hook to delete matched resources when the remove option is set.

InlineData.prototype.sources(file, context)

Convert resources for each matched file.

InlineData.prototype.after(context)

Deletes matched resources from the compilation assets when the remove option has been enabled.