0.1.0 • Published 3 years ago

snowpack-plugin-string v0.1.0

Weekly downloads
2
License
WTFPL
Repository
github
Last release
3 years ago

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

NameTypeDefaultDescription
extsArray<string>["jpg","jpeg","png","svg"]Specifying the extensions of a file will be inlined with.
limitboolean | number | string10240Specifying the maximum size of a file in bytes.
encodingstringbase64Specify the encoding which the file will be inlined with.