Does not work with browserify -r option
chentsulin opened this issue · 4 comments
chentsulin commented
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');
mattdesl commented
What version of browserify? your code works with 5.11.2
nikku commented
I can reproduce this issue using browserify 6.3.2 / brfs 1.2.0.
chentsulin commented
I use browserify 6.3.2 / brfs 1.2.0, too
nikku commented
Not working with browserify@7 either.
Configuring brfs to be a global transform and it will perform the replacement properly.