-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
Provide a browser-only export #17
Provide a browser-only export #17
Conversation
package.json
Outdated
"exports": { | ||
".": "./index.js", | ||
"./filenamify": "./filenamify.js", | ||
"./filenamify-path": "./filenamify-path.js" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not what we discussed in the issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not 100% sure what you mean here, but if you meant that you don't want to provide the filenamify-path
export then I've just pushed a commit that removes it.
I've also changed the name of the filenamify
export to browser
, as suggested by you in the issue. Again, it's always easy to change it.
And if there's anything else you want changed, please feel free to tell me and I'll change it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's what I meant. Sorry if that was not clear.
Can you just mention the |
Just added that note 👍 |
One last thing, you need to update the |
Ah, sorry about that. I've never actually published a npm package myself, so I didn't know exactly what that property was for (or how to test if everything works properly!) |
sindresorhus/np#456 will help with this when merged. And sindresorhus/np#82 even more so. |
Fixes #16.
This splits up the code into
filenamify.js
andfilenamify-path.js
, whereindex.js
imports both and provides the export as it is today, so this should not be a breaking change.The user can now also import just
filenamify/filenamify
(can think about a better name maybe) to only get the browser-ready implementation that doesn't rely on Node'spath
.Nothing has changed code-wise, I've just moved things around.