Skip to content

Bundle includes UA-Parser twice & other bundle issues #612

@StefKors

Description

@StefKors

Expected Behavior

the UA-parser package should be only imported once

Current Behavior

somewhere in the rollup config it imports UA-parser twice

Screenshot 2024-10-30 at 13 31 47

Possible Solution

see: https://github.com/StefKors/amplitude-client-vite
I've setup a basic repo to show what would be possible and highlight bundle issues in Amplitude Javascript. Reducing bundle size from 296 kb to 122.88 kB.

Using detect-ua instead of @amplitude/ua-parser-js will further reduce the bundle size to 96.37 kB

Steps to Reproduce

  1. configure rollup bundle visualizer
  2. run npm run build

Environment

  • JS SDK Version:
  • Installation Method:
  • Browser and Version:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions