bloomer icon indicating copy to clipboard operation
bloomer copied to clipboard

Problems with Rollup and Bloomer

Open alerizzo opened this issue 7 years ago • 2 comments

Suddenly, I stop being able to publish a library that uses bloomer with rollup during its deploy. The error was with the classNames import, but actually, it was with every import that was not a namespace. So, in bloomer all imports are written in the form import * as ______ from ______;

This seems ok for namespaces, but it is not for functions. So, is ok for React, but wrong for classNames. If you import functions like import ______ from ________; there's no problem at all....

Here is the source to the rollup discussion: https://github.com/rollup/rollup/issues/670#issuecomment-223046229

I'm not sure if this is a rollup problem, or a bloomer problem.... But people at rollup says is wrong to import a function as a namespace. So....

alerizzo avatar Aug 24 '18 18:08 alerizzo

That's true, actually this was because of the version of TS. Thanks to bring this issue. What we need here is upgrade TS and add this in our tsconfig.json:

"allowSyntheticDefaultImports": true,
"esModuleInterop": true,

Then we need to refactor all of our imports from import * as XXX from 'XXX' to import XXX from 'XXX'. For now I'm having a lot of issues with internet (moving to Japan and they are not very English friendly :/ ). You want to do that change, check your rollup and then make a PR for this change?

AlgusDark avatar Aug 27 '18 01:08 AlgusDark

@AlgusDark are you still here?

alerizzo avatar Mar 21 '19 17:03 alerizzo