Skip to content
Rollup plugin that inliing fs.readFile contents.
TypeScript JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
src init Jul 6, 2019
test init Jul 6, 2019
.gitignore init Jul 6, 2019
.travis.yml init Jul 6, 2019
LICENSE init Jul 6, 2019 Add Known Problems Jul 6, 2019
package.json 1.0.1 Jul 6, 2019
tsconfig.json init Jul 6, 2019
yarn.lock init Jul 6, 2019

rollup-plugin-brfs Build Status

Rollup plugin that inliing fs.readFile contents.

This plugin use browserify/brfs. It supports that

  • fs.readFileSync(pathExpr, enc=null)
  • fs.readFile(pathExpr, enc=null, cb)
  • fs.readdirSync(pathExpr)
  • fs.readdir(pathExpr, cb)

Known Problems

browserify/brfs does not support ES module.

import fs from "fs";
const text = fs.readFileSync(__dirname + "/", "utf-8");

It does not inlined.

If you used babel, babel-plugin-static-fs will resolve it.


Install with npm:

npm install rollup-plugin-brfs


// rollup.config.js
import brfs from 'rollup-plugin-brfs';

export default {
  input: 'src/main.js',
  output: {
    file: 'dist/bundle.js',
    format: 'iife'

  plugins: [


export type rollupBrfsOptions = {
    // Default:  [".js", ".jsx", ".ts", ".tsx"]
    extensions?: string[]
    brfsOptions?: {}


See Releases page.

Running tests

Install devDependencies and Run npm test:

npm test


Pull requests and stars are always welcome.

For bugs and feature requests, please create an issue.

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D



MIT © azu

You can’t perform that action at this time.