Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work with browserify -r option #37

Open
chentsulin opened this issue Nov 17, 2014 · 4 comments
Open

Does not work with browserify -r option #37

chentsulin opened this issue Nov 17, 2014 · 4 comments

Comments

@chentsulin
Copy link

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 chentsulin changed the title Didn't work with browserify -r option Does not work with browserify -r option Nov 17, 2014
@mattdesl
Copy link
Collaborator

What version of browserify? your code works with 5.11.2

@nikku
Copy link

nikku commented Nov 19, 2014

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

@chentsulin
Copy link
Author

I use browserify 6.3.2 / brfs 1.2.0, too

@nikku
Copy link

nikku commented Dec 19, 2014

Not working with browserify@7 either.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants