一覧へ戻る
azu/rollup-plugin-brfs(新しいタブで開きます)
主要言語: TypeScript
Rollup plugin that inliing fs.readFile contents.
- star 数
- 2
- watcher 数
- 0
- fork 数
- 1
- issue 数
- 2
- 最終更新
- 2019/11/02
主要言語: TypeScript
Rollup plugin that inliing fs.readFile contents.
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)browserify/brfs does not support ES module.
import fs from "fs"; const text = fs.readFileSync(__dirname + "/readme.md", "utf-8"); console.log(text);
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: [ brfs() ] };
export type rollupBrfsOptions = { // Default: [".js", ".jsx", ".ts", ".tsx"] extensions?: string[] // https://github.com/browserify/brfs#var-tr--brfsfile-opts brfsOptions?: {} }
See Releases page.
Install devDependencies and Run npm test:
npm test
Pull requests and stars are always welcome.
For bugs and feature requests, please create an issue.
git checkout -b my-new-featuregit commit -am 'Add some feature'git push origin my-new-featureMIT © azu