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

Shorten sourceURLs #6

Closed
jhnns opened this issue Jul 6, 2012 · 7 comments
Closed

Shorten sourceURLs #6

jhnns opened this issue Jul 6, 2012 · 7 comments

Comments

@jhnns
Copy link
Member

jhnns commented Jul 6, 2012

Why do all source URLs start with webpack-module:// and than include the absolute file path? I think it would be more readable to just include the path after the module root. E.g. the file /home/jhnns/node/myModule/lib/printHello.js would appear as myModule/lib/printHello.js.

Currently I'm using Chrome to debug my scripts and it's kind of annoying to always resize the scripts panel to see how the actual filename is (because of the webpack-module prefix and the absolute path the string is quite long).

Despite of that, could you add to the readme that the debug option is also available when using the programmatic interface?

sokra added a commit that referenced this issue Jul 6, 2012
@sokra sokra closed this as completed in f33da58 Jul 6, 2012
@sokra
Copy link
Member

sokra commented Jul 6, 2012

a while ago this did work in chrome (i'm using it too) but some change in chrome changed it...
Should be fixed now again...

You need to check "Show script folders" in chrome dev tool settings (bottom right corner).

@jhnns
Copy link
Member Author

jhnns commented Jul 6, 2012

Now it's working, thanks. I've checked the "Show script folders" already. But I was annoyed that the folders also start with the full absolute path.

@sokra sokra reopened this Jul 6, 2012
@jhnns
Copy link
Member Author

jhnns commented Jul 10, 2012

Compare these two paths from browserify and webpack:

/test/simpleTest/simpleTest.test.js:34
webpack-module:///home/jhnns/node/nodeclass/test/simpleTest/simpleTest.test.js:33

The first path provides a much nicer debug experience (e.g. in stack traces, etc.) since it omits the uninteresting parts.

@sokra sokra closed this as completed in 514ad01 Jul 11, 2012
@sokra
Copy link
Member

sokra commented Jul 11, 2012

sourceUrl is shortened the way stats was processed.

./ project directory
../ parent of project directory
~ = node_modules

@jhnns
Copy link
Member Author

jhnns commented Jul 11, 2012

Looks good. But if I'm using a loader, such as bundle, the loader-path is prepended. For instance:

webpack-module:///(webpack)/~/bundle-loader/lazy.js!./pages/Blog/BlogPage.class.js

Is this intended? I don't think that the loader is important for the debug view.

@sokra
Copy link
Member

sokra commented Jul 11, 2012

It's intended and importent. The bundle loader is a good example.

If you use the bundle loader you have 2 modules included

webpack-module:///(webpack)/~/bundle-loader/lazy.js!./pages/Blog/BlogPage.class.js
webpack-module:///./pages/Blog/BlogPage.class.js

If we would not prepend the loader the module names are not unique and would collide.

@jhnns
Copy link
Member Author

jhnns commented Jul 11, 2012

Sounds reasonable.

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

2 participants