catc/react-timekeeper

NPM package contains original files next to the transpiled ones

pokonski opened this issue · 2 comments

Hey @catc

I encountered a bug where doing import TimeKeeper from 'react-timekeeper';

results in an error:

image

Because the NPM package contains both the .jsx and compiled .js file. That in turn confuses webpack into loading the original, instead of compiled.

Can this be fixed?

A bypass for this would be to force babel-loader to trans-pile just react-timekeeper package, but it's an ugly exception to make.

catc commented

I think the issue here is that babel isn't recognizing the object spread operator.

If you're using babel-loader, have you tried adding transform-object-rest-spread? Lemme know if that fixes it.

Nvm, misread the issue. Should be an easy fix.