rollup-plugin-image-files
Like rollup-plugin-image, but writes image files to dest instead of inlining base64.
Last updated a month ago by bradspaulding .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install rollup-plugin-image-files 
SYNC missed versions from official npm registry.

rollup-plugin-image-files

Like rollup-plugin-image, but writes image files to dest instead of inlining base64. This was written for a library that would be consumed by react-native applications.

Usage

Install the plugin via npm:

npm install --save-dev rollup-plugin-image-files

Add the plugin to your rollup config:

import images from 'rollup-plugin-image-files';

export default {
  entry: 'src/index.js',
  des: 'dist/bundle.js',
  plugins: [images()]
}

Require some images in your source:

import React from 'react';
import { Image } from 'react-native';
import imageSrc from '../path/to/image.png';

export default const MyComponent = () => (
  <Image source={imageSrc}/>
);

What it does

The plugin does two things:

  1. Copies the source image into the same directory as the destination file.
  2. Replaces the image required with a module that exports the result of calling require on the copied image.

Current Tags

  • 1.4.2                                ...           latest (a month ago)

7 Versions

  • 1.4.2                                ...           a month ago
  • 1.4.1                                ...           2 months ago
  • 1.4.0                                ...           2 months ago
  • 1.3.0                                ...           8 months ago
  • 1.2.0                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 32
Dependencies (2)
Dev Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |