path-browserify
path-browserify copied to clipboard
require('path-browserify')
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...
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.
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)