czizzy / rollup-plugin-binary2base64

Converts binary files to base64 string modules

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rollup-plugin-binary2base64

Converts binary files to base64 string modules

import binaryBase64 from "./data.bin";
console.log(`data base64 string: ${binaryBase64}`);

Installation

npm i rollup-plugin-binary2base64 -D

Usage

import { rollup } from "rollup";
import { binary2base64 } from "rollup-plugin-binary2base64";

rollup({
  entry: "main.js",
  plugins: [
    binary2base64({
      // Required to be specified
      include: ["**/*.wasm", "**/*.bin"]

      // Undefined by default
      exclude: ["**/exclude.bin"]
    })
  ]
});

License

MIT © Izzy Chen

About

Converts binary files to base64 string modules

License:MIT License


Languages

Language:JavaScript 100.0%