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

Output file name overwritten by generated.js #14

Closed
niksy opened this issue Mar 28, 2015 · 9 comments
Closed

Output file name overwritten by generated.js #14

niksy opened this issue Mar 28, 2015 · 9 comments

Comments

@niksy
Copy link

niksy commented Mar 28, 2015

When using CLI, generated source maps file property points to generated.js even though command given should output to some other file.

For example:

node_modules/.bin/browserify ./foo.js --debug | node_modules/.bin/exorcist bundle.js.map > foo.o1.js
@thlorenz
Copy link
Owner

That's not a problem. The generated.js is just a placeholder and actually not used by any tool.

@wnr
Copy link

wnr commented Jul 25, 2016

Hi, this seems to be the case when using the JavaScript API as well.

The generated.js is just a placeholder and actually not used by any tool.

This is not true, as Uglify's --in-source-map uses the property, and potentially future tools might depend on this property being correct. I suggest reopening this issue.

@wnr
Copy link

wnr commented Jul 25, 2016

When changing the file property to the correct value manually, the source maps no longer works as expected. The file mapping seems to be a bit off as the wrong content is displayed (file A shows the content of file B, etc.). I haven't been able to identify a pattern.

It is perhaps not possible to alter such values of source maps manually after generation, but I'm adding this information here for the record as a warning for others.

@bendrucker
Copy link
Collaborator

What is the correct value here?

@wnr
Copy link

wnr commented Jul 25, 2016

If the source code file is called a.js and the source maps of that file is called a.js.map I believe the expected value is a.js of the file property.

@bendrucker
Copy link
Collaborator

So to be clear, the original post title implying that this was specific to the CLI is inaccurate?

@wnr
Copy link

wnr commented Jul 25, 2016

Yes.
On Mon, 25 Jul 2016 at 22:37, Ben Drucker notifications@github.com wrote:

So to be clear, the original post title implying that this was specific to
the CLI is inaccurate?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#14 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAr6w3coJ4bhbwrFtJMFLJ1iVOCi0_k8ks5qZR6BgaJpZM4D2Ueg
.

@bendrucker bendrucker changed the title Output file name when using CLI Output file name overwritten by generated.js Jul 25, 2016
@bendrucker
Copy link
Collaborator

FYI, that filename comes all the way from here:

https://github.com/thlorenz/combine-source-map/blob/master/index.js#L60

Haven't had time to properly debug it myself but wanted to leave a hint for anyone who wants to play around.

@bendrucker
Copy link
Collaborator

Actually that doesn't seem to be called from the tests so that may be a false flag. I'm not planning on looking into this any further but will happily review a PR if someone figures out how to resolve this.

@niksy niksy closed this as completed Jul 26, 2018
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

4 participants