A Rollup plugin that copies imported files of specified extensions (e.g., .wav, .doc) to an output directory and optionally adds a content hash to the filename, enabling import of non-JS assets in Rollup bundles. Version 1.0.1 is the latest stable release. It requires an explicit extension pattern and output path, making it suitable for projects that need to bundle static assets alongside JavaScript. Unlike similar plugins (e.g., @rollup/plugin-image, rollup-plugin-copy), it focuses on generic file copying with hashing and is minimal in configuration.
npm install rollup-plugin-import-fileVerified import paths — ran on the pinned version, not inferred.
Configures Rollup to copy image imports to 'dist/assets' with content hashing, and demonstrates importing a PNG file.
Ensure all imported file types are included in the `extensions` regex pattern, e.g., /.(wav|doc|png)$/.
Use the plugin exclusively in Rollup configuration.
Specify a relative path like 'assets/files' or use path.resolve to ensure it is within the output directory.
Run `npm install --save-dev rollup-plugin-import-file` or `yarn add --dev rollup-plugin-import-file`.
Use default import: `import files from 'rollup-plugin-import-file'`.
Use `import files from 'rollup-plugin-import-file'` instead.
No dependency data recorded yet.