Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] How to reduce Crepe bundle size? #1533

Open
2 tasks done
sindras opened this issue Oct 11, 2024 · 1 comment
Open
2 tasks done

[Bug] How to reduce Crepe bundle size? #1533

sindras opened this issue Oct 11, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@sindras
Copy link
Contributor

sindras commented Oct 11, 2024

Initial checklist

  • I agree to follow the code of conduct
  • I searched issues and discussions and couldn’t find anything (or linked relevant results below)

Affected packages and versions

Crepe

Link to runnable example

https://stackblitz.com/edit/github-gpc2xr

Steps to reproduce

To reproduce:

  1. Create a Vite-based React project.
  2. Create an editor with milkdown-crepe. Disable the CodeMirror.
  3. Try building the assets vite build, notice that all CodeMirror languages are still bundled in the output.

Expected behavior

The unused features should be dropped from final output. Or, create a more reasonable defaults by limiting the number of CodeMirror supported languages to popular ones such as HTML, CSS, JS, Python, C++, PHP, Java, SQL, etc instead of including Brainfuck?

Actual behavior

All language and CodeMirror specific code are still bundled together after running vite build, under the dist/assets folder.

Runtime

No response

OS

No response

Build and bundle tools

Remix

@sindras sindras added the bug Something isn't working label Oct 11, 2024
@seangwright
Copy link

seangwright commented Oct 27, 2024

I would love to know how to tree-shake out all those unused languages. Even when I supply an explicit list, the full set ends up in my bundle. I think it could be caused by this dynamic import

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants