supabase-community / auth-ui

Pre-built Auth UI for React
https://supabase.com/docs/guides/auth/auth-helpers/auth-ui
MIT License
487 stars 121 forks source link

Don't include all of lodash in the bundle #45

Closed louwers closed 1 year ago

louwers commented 1 year ago

Chore

Describe the chore

lodash is not tree-shakable. So about 69.9kB of your 127.7kB (minimized) bundle size is used for this single import:

import { merge } from 'lodash'

Instead you should import

import merge from 'lodash/merge'

this is 'just' 9.8 kB.

netgfx commented 1 year ago

running into Error in 'codeFile/Auth.tsx': SyntaxError: The requested module 'https://ga.jspm.io/npm:lodash@4.17.21/lodash.js' does not provide an export named 'merge'

when trying to directly import the library via ESM modules

Specifically on Framer via https://www.framer.com/npm/