{"id":27352,"library":"rollup-plugin-file","title":"rollup-plugin-file","description":"Rollup plugin that allows a file object (e.g., from Gulp) to be used as an entry point, supporting vinyl files with a `base` property. Current version 0.1.1 is an early release with no tests, no updates since 2017, and no maintenance. Differentiates from standard Rollup entry by accepting file objects rather than file paths, primarily for integration with Gulp streams. Likely abandoned; caution advised for production use.","status":"abandoned","version":"0.1.1","language":"javascript","source_language":"en","source_url":"https://github.com/simplaio/rollup-plugin-file","tags":["javascript","rollup","file","plugin"],"install":[{"cmd":"npm install rollup-plugin-file","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-file","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-file","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"The plugin is designed to be used with Rollup as a plugin","package":"rollup","optional":false}],"imports":[{"note":"Default export, both ESM and CJS work but require .default in commonjs","wrong":"const rollupFile = require('rollup-plugin-file').default","symbol":"default","correct":"import rollupFile from 'rollup-plugin-file'"},{"note":"Named export does not exist; only default export is available","wrong":"","symbol":"rollupFile","correct":"import rollupFile from 'rollup-plugin-file'"},{"note":"CommonJS users must use .default or use default property","wrong":"const rollupFile = require('rollup-plugin-file'); // missing .default","symbol":"plugin","correct":"import rollupFile from 'rollup-plugin-file';\n// then use in plugins: [rollupFile()]"}],"quickstart":{"code":"import { rollup } from 'rollup';\nimport rollupFile from 'rollup-plugin-file';\nimport gulp from 'gulp';\nimport through from 'through2';\n\ngulp.task('build', function() {\n  return gulp.src('./src/*.js')\n    .pipe(through.obj(function(file, enc, done) {\n      rollup({\n        entry: file,\n        plugins: [rollupFile()]\n      }).then(bundle => {\n        file.contents = Buffer.from(bundle.generate({format: 'iie'}).code);\n        done(null, file);\n      }).catch(done);\n    }))\n    .pipe(gulp.dest('./dist'));\n});","lang":"javascript","description":"Shows basic usage with Gulp: takes a vinyl file stream and bundles each file using Rollup with the file plugin."},"warnings":[{"fix":"Consider alternative plugins like @rollup/plugin-url or rollup-plugin-stream","message":"The package has no tests, no maintenance since 2017, and is likely abandoned.","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Ensure you pass a file object with `base` set, or use gulp-rollup-file wrapper","message":"The entry file must have a `base` property (e.g., vinyl file from Gulp). Using a string path will fail.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use with Rollup 0.x or find alternative for Rollup 1+","message":"The plugin does not support modern Rollup versions (>=1.0.0); it only works with Rollup 0.x.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use a vinyl file object from Gulp or manually add `base` property to the file object.","cause":"Passing a string path instead of a file object with `base`.","error":"Error: The `entry` option must be a string, string array, or an object with a `base` property."},{"fix":"Add rollupFile() to plugins array; check Rollup version compatibility (0.x only).","cause":"Plugin not included in plugins array or Rollup version incompatible.","error":"TypeError: Cannot read property 'resolveId' of undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}