dzcpy / transliteration

UTF-8 to ASCII transliteration / slugify module for node.js, browser, Web Worker, React Native, Electron and CLI.

Home Page:http://dzcpy.github.io/transliteration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

‘browser’ breaks ‘main’ using Browserify and broken ember-cli

henrymazza opened this issue · comments

I’m using transliteration with ember-browserify and it loads lib/browser instead of lib/node generating an ./x0.json not found error. This started to happen after upgrading transliteration to 1.5.x from 1.2.x.

I’m new to these toos so this is what I found: Browserify uses browser as alternative to main entry when reading package.json. So it’s probably what causes it to load the wrong version.

It should be possible to change the main entry point by other means but it looks like ember-cli doesn’t like non-default main.

So, is transliteration stepping over browserify’s toe reusing the ‘browser’ attribute; is it something usual; or is it me that am using inadequate tools and don’t know how to config it right?

PS: For now I’m downgrading, but it’s easy to fix 1.5.2 by renaming ‘browser’ to something else. Also it could be possible to write a index.js file at root level or some other voodoo.

commented

Hi Henry,
Thanks for using this module. I will take a look and hopefully fix it soon.

commented

I have made a small change to revert a possible problematic config setting in package.json. Could you test it again with v1.5.3?

Works like a charm! Won’t anyone miss that line?

commented

Thanks for your feedback, I'm glad it worked!