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

require('path-browserify') #27

Open
schkolne opened this issue May 4, 2022 · 2 comments
Open

require('path-browserify') #27

schkolne opened this issue May 4, 2022 · 2 comments

Comments

@schkolne
Copy link

schkolne commented May 4, 2022

hmmm, the README says to write: var path = require('path')

that didn't work for me, however it did work when i wrote: var path = require('path-browserify')

i highly doubt the README is wrong given how many people use this package, scratching my head here a bit...

@goto-bus-stop
Copy link
Member

The intent is for this package to be used in a bundling scenario, where your bundler will resolve require('path') to this package. This is what happens with browserify by default or with an appropriate resolve config in webpack. That way code that uses the node.js builtin path module can be bundled for the browser with no modifications.

@assd12138
Copy link

hmmm, the README says to write: var path = require('path')

that didn't work for me, however it did work when i wrote: var path = require('path-browserify')

i highly doubt the README is wrong given how many people use this package, scratching my head here a bit...

you can use patch-package to fix it and add path-browserify manually in dependencies when you don't have the browserify environment in your project, it works fine in my react-native project(it use the metro as a bundler)

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

3 participants