fusionjs / fusion-cli

Migrated to https://github.com/fusionjs/fusionjs
MIT License
140 stars 37 forks source link

Add a tree shaking test that involves the use of Flow types #771

Open AlexMSmithCA opened 5 years ago

AlexMSmithCA commented 5 years ago

As part of the investigation into looking into WPT-2994 this PR adds a new test to ensure that imports/exports that include Flow types are properly stripped and tree shaken.

AlexMSmithCA commented 5 years ago

I was having trouble reproducing whether code was leaking into the browser due to Flow imports:

e.g.

import type {AType} from ... // no leak
import {B} from ...

vs.

import {type AType, B} from ... // potential leak

Not entirely sure why, but tree splitting seems to be failing for node module dependency imports as a separate concern.