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

Problem with path for vertx.js for browserify v7.0.2. #339

Merged
merged 2 commits into from
Dec 20, 2014

Conversation

mjancarik
Copy link
Contributor

Browserify wants to load file from 'dist' folder, but vertx.js is in the root folder.

Browserify wants to load file from 'dist' folder, but vertx.js is in the root folder.
@stefanpenner
Copy link
Collaborator

please use: browserify -x vertx

@mjancarik
Copy link
Contributor Author

I use gulp for build and I got Error.

Error: Cannot find module 'vertx' from '/web/node_modules/rsvp/dist'.

It is true because you want to require vertx.js from rsvp/dist folder, but vertx.js is in the root folder.

My gulp is:

browserify(files.src, {debug: true, insertGlobals : true})
    .bundle()
        .pipe(source(files.name))
        .pipe(gulp.dest(files.dest))

Do you have a solution?

@stefanpenner
Copy link
Collaborator

It is true because you want to require vertx.js from rsvp/dist folder, but vertx.js is in the root folder.

require('vertx') is for users of http://vertx.io/ your solution breaks RSVP for them. Maybe their is a way to annotate a require to be ignored by browserify?

@stefanpenner
Copy link
Collaborator

ah we can just do

var r = require;
r('vertx');

this will prevent browserify from detecting the require. If you can update the PR accordingly, I'll gladly merge.

@stefanpenner stefanpenner reopened this Dec 16, 2014
@domenic
Copy link
Contributor

domenic commented Dec 16, 2014

Or use the browser field in package.json, which is cleaner.

@stefanpenner
Copy link
Collaborator

Or use the browser field in package.json, which is cleaner.

mind linking to a doc on that?

@domenic
Copy link
Contributor

domenic commented Dec 16, 2014

@fivetanley
Copy link
Contributor

https://github.com/substack/browserify-handbook#browser-field

oops didn't see domenic's reply and forgot to refresh :P

@stefanpenner
Copy link
Collaborator

ah so

"browser": {
    "vertx": false
  }

?

@mjancarik
Copy link
Contributor Author

Thank you for yours suggestions

Fix for browserify.
@stefanpenner
Copy link
Collaborator

@microx i believe @domenic is suggesting it should be possible to configure browserify in rsvp.js package.json to skip this without the indirection. Do you mind updating?

@mjancarik
Copy link
Contributor Author

Yes, it is possible and I fixed it for me, but I think that rsvp call require vertx so it will call right way. You have empty file vertx.js in root, where is comment 'to make browserify happy about trying to require('vertx')'. What do you think?

@stefanpenner
Copy link
Collaborator

You have empty file vertx.js in root, where is comment 'to make browserify happy about trying to require('vertx')'. What do you think?

this file was a quick hack that we shouldn't have around.

stefanpenner added a commit that referenced this pull request Dec 20, 2014
Problem with path for vertx.js for browserify v7.0.2.
@stefanpenner stefanpenner merged commit 7026f6f into tildeio:master Dec 20, 2014
@stefanpenner
Copy link
Collaborator

will investigate the browserify package.json entry later

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

Successfully merging this pull request may close these issues.

4 participants