Skip to content

Rollup plugin. Emit import files. Replace import to relative path.

License

Notifications You must be signed in to change notification settings

r0kan/rollup-plugin-file-import

Repository files navigation

rollup-plugin-file-import

This plugin allows you to emit files to rollup bundle.

Install

yarn add rollup-plugin-file-import --dev

or

npm install rollup-plugin-file-import -D

Usage

// rollup.config.js

import fileImport from 'rollup-plugin-file-import'

export default {
  // ...
  plugins: [
    fileImport([
      {
        // absolute path to output directory
        outputDir: `/user/project/public/images`,
        extensions: ['.png', '.jpg', '.jpeg'],
      },
    ])
  ]
}

Options

{
  outputDir: string,
  extensions: string[],
}[]

outputDir

Absolute path to output directory

Required

extensions

File extension (.png, .jpg)

Required

About

Rollup plugin. Emit import files. Replace import to relative path.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published