rangy icon indicating copy to clipboard operation
rangy copied to clipboard

Modules are not loaded properly when using NPM

Open rexytseng opened this issue 10 years ago • 8 comments

Hi Tim,

I'm using Node and NPM. After I do npm install, the following modules are not loaded:

rangy-classapplier.js rangy-highlighter.js rangy-selectionsaverestore.js rangy-serializer.js rangy-textrange.js

I took a closer look, I see that the module files are included in the npm package, but are not loaded properly via package.json.

rexytseng avatar Sep 04 '15 17:09 rexytseng

I am using this workaround:

import rangy from 'rangy';
import rangyHighlight from 'rangy/lib/rangy-highlighter';
import rangyClassApplier from 'rangy/lib/rangy-classapplier';
import rangyTextRange from 'rangy/lib/rangy-textrange';
import rangySerializer from 'rangy/lib/rangy-serializer';

LeZuse avatar Nov 20 '15 18:11 LeZuse

Thanks man!

rexytseng avatar Nov 20 '15 18:11 rexytseng

Apologies. I have had other priorities in recent months. I'll get to this as soon as I can.

timdown avatar Nov 26 '15 22:11 timdown

@timdown How would you go about it? I could take a look at it and send a PR.

LeZuse avatar Nov 27 '15 08:11 LeZuse

This caught me too, but you might want to leave it as-is and document it.

In the current state, you can only require the parts of the library you need, which is kind of nice.

dgfitch avatar Dec 27 '15 23:12 dgfitch

Encountered this, this really needs to be documented.

bfintal avatar Nov 01 '17 11:11 bfintal

@LeZuse Thanks man but youdon't need to use named imports this peace of code works also

import rangy from 'rangy';
import 'rangy/lib/rangy-classapplier';
import 'rangy/lib/rangy-highlighter';
import 'rangy/lib/rangy-textrange';
import 'rangy/lib/rangy-serializer';

MohammedEssehemy avatar Jan 25 '18 10:01 MohammedEssehemy

:+1: faced this

derrandz avatar May 30 '18 21:05 derrandz