Search code examples
rangebrowserifyrangy

Rangy ClassApplier and browserify


I'm using browserify to manage dependencies. require('rangy') seems to only import rangy-core, but not its sub-modules.

How can I import rangy-classapplier?

If I import the file (require('./node_modules/rangy/lib/rangy-classapplier.js')) it works, but I'd like to do it without having to include the file address.


Solution

  • I think

    require('rangy/lib/rangy-classapplier.js');
    

    is what you want, at least as things are now. I don't see a neat way for me to make the path any simpler; I don't want to clutter the root directory. Possibly the rangy- prefix is unhelpful and I should get rid of it but I'll have a think about that.