Chrome扩展fb-flo.zip
fb-flo 是一个 Chrome 扩展,它可以让你不需要重载就能改变运行中的 APP。它很容易就能整合你建立的系统、dev 环境,并且能用于你最喜欢的编辑器上。示例代码:var flo = require('fb-flo'), path = require('path'), fs = require('fs');var server = flo( sourceDirToWatch, { port: 8888, host: 'localhost', verbose: false, glob: [ // All JS files in `sourceDirToWatch` and subdirectories '**/*.js', // All CSS files in `sourceDirToWatch` and subdirectories '**/*.css' ] }, function resolver(filepath, callback) { // 1. Call into your compiler / bundler. // 2. Assuming that `bundle.js` is your output file, update `bundle.js` // and `bundle.css` when a JS or CSS file changes. callback({ resourceURL: 'bundle' path.extname(filepath), // any string-ish value is acceptable. i.e. strings, Buffers etc. contents: fs.readFileSync(filepath), update: function(_window, _resourceURL) { // this function is executed in the browser, immediately after the resource has been updated with new content // perform additional steps here to reinitialize your application so it would take advantage of the new resource console.log("Resource " _resourceURL " has just been updated with new content"); } }); } ); 标签:fbflo
- 1
- 粉丝: 509
- 资源: 1万+
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助