Is it expected that a very simple Plate editor would add 332.65 kB to compressed, and tree shaken, bundle size? #2019
-
I'm only using basic marks (bold, italic, underline), links, mentions and the balloon toolbar. When I explored the source maps I was surprised to see docx-cleaner, plate-ui-dnd, plate-ui-media, plate-table, plate-indentlist, plate-code-block, plate-list, etc., etc. Plus prism.js, micromark, js-video-url-parser which I'm guessing, but don't know for sure, are pulled in by Plate. What am I doing wrong?
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Plate should be fully tree-shakeable. Anything proven to not be so will be extracted into another package. For example, micromark seems to be tree-shakeable. How could we prove it's not? Note that tree-shaking depends on your build setup. |
Beta Was this translation helpful? Give feedback.
-
@zbeyens That's encouraging. I must be doing something very wrong then. How do I get tree shaking working for Plate with the default create-react-app scripts? Below is what I'm doing right now, and, as you can see adding the most minimal Plate editor is adding 477.75 kB to the compressed size of an empty app. Relevant version info from package.json
What I'm running:
|
Beta Was this translation helpful? Give feedback.
-
https://platejs.org/ now encourages installing only the packages you need. |
Beta Was this translation helpful? Give feedback.
https://platejs.org/ now encourages installing only the packages you need.