Skip to content

Inefficient bundling detected? #2562

Answered by pskelin
hrstoyanov asked this question in Q&A
Discussion options

You must be logged in to vote

You should use a plugin that makes URLs out of JSON imports instead of inlining them. Every bundler should support both options, unfortunately some use inlining which is not a good default for our use case.

This plugin should do the right thing for snowpack
https://www.npmjs.com/package/snowpack-plugin-url-loader

in the config, put json in the extensions you want loaded as URLs, and set limit to 0 (so they are never inlined).

Make sure to check the network tab before and after to see why the warnings are there - bundle should be much smaller.

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by ilhan007
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@hrstoyanov
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants