brfs icon indicating copy to clipboard operation
brfs copied to clipboard

Does not work with browserify -r option

Open chentsulin opened this issue 10 years ago • 4 comments

Below is my test.js :

var fs = require('fs');
var html = fs.readFileSync(__dirname + '/widget.html', 'utf8');
module.exports = Test;
function Test () {};

Use brfs without -r :

browserify -t brfs ./test.js

will get correctly compiled string :

var html = "<form class=\"send\">\n  <textarea type=\"text\" name=\"msg\"></textarea>\n  <input type=\"submit\" value=\"submit\">\n</form>";

But use with -r :

browserify -t brfs -r ./test.js:test 

fs code will not be compiled :

var html = fs.readFileSync(__dirname + '/widget.html', 'utf8');

chentsulin avatar Nov 17 '14 11:11 chentsulin

What version of browserify? your code works with 5.11.2

mattdesl avatar Nov 19 '14 17:11 mattdesl

I can reproduce this issue using browserify 6.3.2 / brfs 1.2.0.

nikku avatar Nov 19 '14 20:11 nikku

I use browserify 6.3.2 / brfs 1.2.0, too

chentsulin avatar Nov 20 '14 02:11 chentsulin

Not working with browserify@7 either.

Configuring brfs to be a global transform and it will perform the replacement properly.

nikku avatar Dec 19 '14 22:12 nikku