@reshoot/macro
TypeScript icon, indicating that this package has built-in type declarations

2.1.6 • Public • Published

Reshoot logo
@reshoot/macro

A babel-macro transpiling reshoot('image.png', { color: '#eee' }) into import meta from 'image.png?color=#eee';.

More about reshoot.

Installation

# PNPM
pnpm add -D @reshoot/macro

# NPM
npm install -D @reshoot/macro

# yarn
yarn add -D @reshoot/macro

Setup

// babel.config.js
module.exports = {
  // ...
  plugins: ['babel-plugin-macros'],
};

API

import reshoot from '@reshoot/macro';

const meta = reshoot(
  './image.png',
  { color: '#eee' } // Optional inline config overriding the loader options
);

Support

This library has been continuously used in many of my personal projects, and is regarded as production-ready. In the foreseeable future, I will continuously maintain and support this library.

Issues and Feedback

Please voice your opinion and report bugs in the issues sections of this GitHub project.

Contributing

You are more than welcome to add more functionalities, improve documentation, fix bugs, and anything you think is needed. The build step is pretty self-explanatory. Please refer to package.json.

License

MIT

/@reshoot/macro/

    Package Sidebar

    Install

    npm i @reshoot/macro

    Weekly Downloads

    0

    Version

    2.1.6

    License

    MIT

    Unpacked Size

    23.1 kB

    Total Files

    11

    Last publish

    Collaborators

    • billykwok