Closed azu closed 8 years ago
Thanks a lot @azu
This is pretty good PR and some tests on my browsers work well.
I never known about browser
field, but it seems to be suitable in this situation.
I have a question or comment on this point. I'd like to get your opinion about that.
Thanks! I can't wait for new release!
@takuyaa Hi, I fixed
require("kuromoji"); // undefeined
issue on some env like Atom.Purpose
Currently,
kuromoji.js
doesn't work on Atom editor(plugin). This pull request fix this issue.require("kuromoji"); // undefeined
in Atom.Changes
window
detection fromsrc/kuromoji.js
andDictionaryLoader
DictionaryLoader
intoBrowserDictionaryLoader
andNodeDictionaryLoader
Atom has
window
object... it means thatmodule.exports = undefined
@src/kuromoji.js
I refactor this feature detection and move feature detection to browserify's build phase. (So, feature detection code was removed)
src/
code use directlyNodeDictionaryLoader
.dist/browser/kuromoji.js
use directlyBrowserDictionaryLoader
(dist/browser/kuromoji.js
doesn't containNodeDictionaryLoader
)I'v added a macro that replace
NodeDictionaryLoader
toBrowserDictionaryLoader
intogulpfile.js
andpackage.json