leebyron / rollup-plugin-flow

Rollup plugin for removing Flow type annotations.
Other
80 stars 11 forks source link

import {MyInterface} seems to break rollup #4

Closed Gozala closed 7 years ago

Gozala commented 7 years ago

In flow you can import interfaces like import {MyInterface} from "module" those do not get stripped which causes rollup to fail with Error: 'MyInterface' is not exported by .... There is a way to workaround this by using import type {MyInterface} instead, but unfortunately not all of the code is under our control & there seems to be no other way around it as far as I can tell.

leebyron commented 7 years ago

Flow interfaces are not runtime values, they are types, so the appropriate way to import them is with import type, otherwise Rollup will look for a runtime value that does not exist

leebyron commented 7 years ago

This problem will appear whenever you attempt to import a value that is not defined by that module