This plugin allows you to emit files to rollup bundle.
yarn add rollup-plugin-file-import --dev
or
npm install rollup-plugin-file-import -D
// 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'],
},
])
]
}
{
outputDir: string,
extensions: string[],
}[]
Absolute path to output directory
Required
File extension (.png, .jpg)
Required