Skip to content

vue-doctor/bundle-size/prefer-dynamic-import ​

Use defineAsyncComponent(() => import('./HeavyComponent.vue')) for heavy components

PropertyValue
CategoryBundle Size
Default Severitywarning
Confidencemedium
FixableNo
Engineoxlint
Sincev1.0.0
Frameworksvue, nuxt
Test filesNot checked (which files)

Why it matters ​

Use defineAsyncComponent(() => import('./HeavyComponent.vue')) for heavy components

How to fix ​

Review the finding and update the code according to best practices below.

Agent Guidance ​

Load heavy libraries or components lazily: defineAsyncComponent(() => import('./Heavy.vue')) for components, await import('lib') where the code is first needed.


Rule source: vue-doctor/bundle-size/prefer-dynamic-import

Released under the MIT License.