- To reproduce the issue, first run an
npm install
. - Then, bundle the application for web by running
npx expo export --platform web
. - Notice that the final bundle (inside
dist/_expo/static/js/web
) includes both the functionfoo
and the functionbar
, even though onlyfoo
is used insideindex.ts
. - Change the import in
index.ts
to a named import (import { foo } from './utils'
) and re-runnpx expo export --platform web
. - Notice that now the final bundle includes only the function
foo
, which clearly indicates that namespace imports are not tree-shaken in the same way as named imports.
-
Notifications
You must be signed in to change notification settings - Fork 0
MrFunctor/expo-tree-shaking-namespace-imports
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Reproduction of Expo tree shaking not removing unused code when using namespace imports
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published