Skip to content

Vite Rollup Production build tree-shaking & Large Blocknote bundles #1870

Description

@candidcalcifer

Describe the bug
Just trying to prune down bundle sizes with Vite Rollup and in general tree shaking

Rendered: 497.25 KB which is actually 4.72%
root/assets/native-48B9X9Wg.js/.../node_modules/.pnpm/@emoji-mart+data@1.2.1/node_modules/@emoji-mart/data/sets/15/native.json
Rendered: 144.67 KB which is actually 1.37%
node_modules/.pnpm/emoji-mart@5.6.0/node_modules/emoji-mart/dist/module.js

Imported by:
node_modules/.pnpm/@blocknote+core@0.33.0_@types+hast@3.0.4/node_modules/@blocknote/core/dist/blocknote.js

node_modules/.pnpm/@blocknote+react@0.33.0_@ty_e6d97ba653bcf8c3995d081f5f7b02b6/node_modules/@blocknote/react/dist/blocknote-react.js

I have emoji picker off but it's still imported, so I'm guessing there's no easy way to not import the emoji picker?

To reproduce: just import standard blocknote view in a Vite (with Rollup) package and do vite build

<BlockNoteView
    emojiPicker={false}
    ref={ref}

Misc

  • Node version: 22.x
  • Package manager: pnpm
  • Browser: Chrome
  • I'm a sponsor and would appreciate if you could look into this sooner than later 💖

Activity

  1. nperez0111 commented on Jul 23, 2025

    @nperez0111
    Contributor

    The emoji picker is dynamically imported. So it should be "rendered" (i.e. available if it hits a path at runtime that requires it), but not actually downloaded by the user

  2. candidcalcifer commented on Jul 23, 2025

    @candidcalcifer
    Author

    okay thanks! so it's part of the bundle but 100% of the time it won't be sent over the wire?

  3. nperez0111 commented on Jul 24, 2025

    @nperez0111
    Contributor

    It should not be, but you would have to validate that in your browser

  4. VCRafa commented on Aug 29, 2025

    @VCRafa

    @nperez0111 do you plan to allow prune of the emoji-mart/data soon?

  5. nperez0111 commented on Aug 31, 2025

    @nperez0111
    Contributor

    @VCRafa, we do not plan on doing this anytime soon given that we need it to support emojis, is it actually downloading for you in the browser (as I described above)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions