snowpack-plugin-inliner

1.0.3 • Public • Published

snowpack-plugin-inliner

A plugin for snowpack which transforms files into base64 URIs.

Usage

Install

npm install --save-dev snowpack-plugin-inliner

Configuration

add this plugin to your Snowpack config:

Commonly

snowpack.config.json

{
  "plugins": [
    ["snowpack-plugin-inliner"]
  ]
}

Custom

snowpack.config.js

module.exports = {
  "plugins": [
    ["snowpack-plugin-inliner", {
      "exts": ["jpg", "png"], // only "jpg" & "png" will be inlined with
      "limit": 66666, // set maximum of file size: 66666 bytes
    }],
  ],
};

Options

Name Type Default Description
exts Array<string> ["jpg","jpeg","png","svg"] Specifying the extensions of a file will be inlined with.
limit `boolean number string`
encoding string base64 Specify the encoding which the file will be inlined with.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.3
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.3
    2
  • 1.0.2
    1
  • 1.0.1
    0
  • 1.0.0
    1

Package Sidebar

Install

npm i snowpack-plugin-inliner

Weekly Downloads

4

Version

1.0.3

License

ISC

Unpacked Size

6.67 kB

Total Files

4

Last publish

Collaborators

  • senze.fan