Hello, if you can help me with the size limit error, that’ll be great.
I’m trying to build my frontity project with the command of npx frontity build
.
After I run the command it returned the following error:
asset size limit: The following asset(s) exceed the recommended size limit (488 KiB).
This can impact web performance.
Assets:
images/hero-background-7c33b6572a611159c2203fea721df2c9.png (1.64 MiB)
webpack performance recommendations:
You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/
Building module bundle
asset size limit: The following asset(s) exceed the recommended size limit (488 KiB).
This can impact web performance.
Assets:
images/hero-background-7c33b6572a611159c2203fea721df2c9.png (1.64 MiB)
webpack performance recommendations:
You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/
The URL shows the Dynamic Imports using require.ensure
. Should I create webpack.config.js in the root of Frontity project? Where should I add the code of src/index.js that has a getComponent() function?
FYI, this is how my src/index/js looks like:
export default {
name: "my-custom-theme",
roots: {
theme: Root,
},
state: {
theme: {
isMenuOpen: false,
},
},
actions: {
theme: {},
},
};
Thank you!