path-browserify icon indicating copy to clipboard operation
path-browserify copied to clipboard

How to use this library from CDN?

Open jcubic opened this issue 4 years ago • 2 comments

I've tried to use on Codepen: https://cdn.jsdelivr.net/npm/path-browserify but this library can't be used in browser because it use module.export not UMD.

So I've tried to use browserify to build standalone file but it doesn't work:

browserify -s path -o path.js -e node_modules/path-browserify/index.js

got error that path.join is not a function because path is empty object.

How anyone can use this library in browser?

jcubic avatar Jul 31 '21 15:07 jcubic

I think that, I've made mistake in config. The library work after running it with browserify. But still I don't understand why the library doesn't provide UMD so you can actually use in browser.

jcubic avatar Jul 31 '21 15:07 jcubic

I don't think this project is meant to be used directly, without using browserify, but maybe this will help you: https://www.jsdelivr.com/package/npm/path-browser

MartinKolarik avatar Jul 31 '21 19:07 MartinKolarik