Skip to content
This repository has been archived by the owner on Sep 8, 2018. It is now read-only.

Latest commit

 

History

History
36 lines (22 loc) · 916 Bytes

README.md

File metadata and controls

36 lines (22 loc) · 916 Bytes

rpi.macro

Build Status Babel Macro

Helper macro for react-precious-image

Usage

Similar to nodejs require call:

import rpi from "rpi.macro";

const meta = rpi("./image.jpg");

Example of usage in create-react-app

import React from "react";
import rpi from "rpi.macro";
import { AdaptiveLoad } from "react-precious-image";

import image from "./images/doggo.jpg";
const meta = rpi("./doggo.jpg");

const App = () => <AdaptiveLoad src={image} alt="doggo" {...meta} />;

Credits

Based on pveyes/raw.macro.

License

MIT