Nostalgic Primordial Monster

    filesize.macro

    0.1.1 • Public • Published

    filesize.macro

    Build Status Babel Macro

    Webpack filesize-loader implemented as babel-plugin-macros

    Usage

    Similar to nodejs require call:

    import filesize from "filesize.macro";
     
    const size = filesize("./image.jpg");

    Example of usage in create-react-app

    import coverImage from "./cover-image.jpg";
    import filesize from "filesize.macro";
    const coverSize = filesize("./cover-image.jpg");
     
    const SomeComponent = () => (
      <div>
        <a href={coverImage}>{`Image size ${coverSize} in bytes`}</a>
      </div>
    );

    Credits

    Based on pveyes/raw.macro.

    License

    MIT

    Install

    npm i filesize.macro

    DownloadsWeekly Downloads

    0

    Version

    0.1.1

    License

    MIT

    Unpacked Size

    28 kB

    Total Files

    16

    Last publish

    Collaborators

    • stereobooster