Skip to content
This repository has been archived by the owner on Mar 20, 2019. It is now read-only.

relative paths question #23

Open
ericgj opened this issue Jan 13, 2013 · 3 comments
Open

relative paths question #23

ericgj opened this issue Jan 13, 2013 · 3 comments

Comments

@ericgj
Copy link
Contributor

ericgj commented Jan 13, 2013

Apologies to ask this support question here, but I didn't see anywhere else to ask. I cannot get browserbuild to work as described in the README. I am sure it's something basic I'm missing.

If I have files b.js and hithere.js as described in the README (all, including the main, in a lib directory), and run browserbuild as described, the output I get looks like this:

// require functions wrapper
require.register("lib/b.js", function(module, exports, require, global){ ... });
require.register("lib/hithere.js", function(module, exports, require, global){ ... });
var exp = require('hithere');if ("undefined" != typeof module) module.exports = exp;else hithere = exp;

And I get an error trying to require('hithere'), since it was registered as 'lib/hithere.js'.

I thought perhaps the base path needed to be provided, e.g. browserbuild -m hithere -b lib ..., but that doesn't work either as it registers it as '/hithere.js' .

The only way I could get it to work is to run within the source dir, e.g. cd lib && browserbuild -m hithere ... .

What am I missing? Thanks in advance.

Eric

@rauchg
Copy link
Contributor

rauchg commented Jan 13, 2013

Try a trailing slash in lib ?

On Sun, Jan 13, 2013 at 2:28 PM, Eric Gjertsen notifications@github.comwrote:

Apologies to ask this support question here, but I didn't see anywhere
else to ask. I cannot get browserbuild to work as described in the README.
I am sure it's something basic I'm missing.

If I have files b.js and hithere.js as described in the README (all,
including the main, in a lib directory), and run browserbuild as described,
the output I get looks like this:

// require functions wrapperrequire.register("lib/b.js", function(module, exports, require, global){ ... });require.register("lib/hithere.js", function(module, exports, require, global){ ... });var exp = require('hithere');if ("undefined" != typeof module) module.exports = exp;else hithere = exp;

And I get an error trying to require('hithere'), since it was registered
as 'lib/hithere.js'.

I thought perhaps the base path needed to be provided, e.g. browserbuild
-m hithere -b lib ..., but that doesn't work either as it registers it as
'/hithere.js' .

The only way I could get it to work is to run within the source dir, e.g. cd
lib && browserbuild -m hithere ... .

What am I missing? Thanks in advance.

Eric


Reply to this email directly or view it on GitHubhttps://github.com//issues/23.

Guillermo Rauch
LearnBoost CTO
http://devthought.com

@ericgj
Copy link
Contributor Author

ericgj commented Jan 13, 2013

thanks, browserbuild -m hithere -b lib/ ... seems to work.

@rauchg
Copy link
Contributor

rauchg commented Jan 13, 2013

BOOM!

On Sun, Jan 13, 2013 at 3:24 PM, Eric Gjertsen notifications@github.comwrote:

thanks, browserbuild -m hithere -b lib/ ... seems to work.


Reply to this email directly or view it on GitHubhttps://github.com//issues/23#issuecomment-12202546.

Guillermo Rauch
LearnBoost CTO
http://devthought.com

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

No branches or pull requests

2 participants