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

fix(CLI): get rid of Browserify absolute path workaround #1449

Merged
merged 1 commit into from May 22, 2017

Conversation

jviotti
Copy link
Contributor

@jviotti jviotti commented May 17, 2017

We encountered a Browserify bug when releasing the CLI, where absolute
paths would be hard-coded in the final bundle. Since we were in the
middle of a release process, we added a quick and dirty
search-and-replace workaround on concatenate-javascript.sh.

After the release, we submitted a PR to Browserify which fixes the
issue. This commit makes use of my personal fork to be able to use such
fix while it gets merged to the main project.

See: browserify/browserify#1725
See: #1409
Fixes: #1429
Signed-off-by: Juan Cruz Viotti jviotti@openmailbox.org

Copy link
Contributor

@lurch lurch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be an awful lot of changes to npm-shrinkwrap.json - are they definitely all wanted / needed / desired?

# module errors when executing it in another computer.
# The fix is to replace absolute paths with `__dirname`
node <<EOF > "$ARGV_OUTPUT.TMP"
const separator = process.platform === 'win32' ? '\\\\\\\\\\\\\\\\' : '\\/';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay, bye bye megabackslashosaurus :-)

@jviotti
Copy link
Contributor Author

jviotti commented May 18, 2017

@lurch We had an older browserify version listed as a development dependency. My fork is running the latest one, which triggered some updated dependencies :)

@lurch
Copy link
Contributor

lurch commented May 18, 2017

Do you need to update this PR to point to the new changes you made on browserify/browserify#1725 ?

EDIT: To clarify my question...

package.json in this PR says

"browserify": "github:jviotti/node-browserify#dynamic-dirname-filename"

but in npm-shrinkwrap.json this gets resolved to a specific commit-hash:

"resolved": "git://github.com/jviotti/node-browserify.git#6ea4c1bd395e86a754131d547c29cc9dffd05b38",

and https://github.com/jviotti/node-browserify/commit/6ea4c1bd395e86a754131d547c29cc9dffd05b38 is a commit from before the most recent fix on that branch https://github.com/jviotti/node-browserify/commit/14691ac9257063000e4aa216073cdad28b9d04e1
I.e. I think that npm-shrinkwrap.json needs updating, which is why I didn't approve this PR yet ;)

We encountered a Browserify bug when releasing the CLI, where absolute
paths would be hard-coded in the final bundle. Since we were in the
middle of a release process, we added a quick and dirty
search-and-replace workaround on `concatenate-javascript.sh`.

After the release, we submitted a PR to Browserify which fixes the
issue. This commit makes use of my personal fork to be able to use such
fix while it gets merged to the main project.

See: browserify/browserify#1725
See: #1409
Fixes: #1429
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
@jviotti
Copy link
Contributor Author

jviotti commented May 22, 2017

Fixed!

@jviotti jviotti force-pushed the browserify-workaround-fork-fix branch from 23e5a0a to 0179813 Compare May 22, 2017 13:44
@jviotti jviotti merged commit 8e681b5 into master May 22, 2017
@jviotti jviotti deleted the browserify-workaround-fork-fix branch May 22, 2017 15:33
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.

Patch Browserify to not include absolute paths in final bundle
2 participants