Skip to content

vue-doctor/bundle-size/no-barrel-import ​

Import from the direct path: import { Button } from './components/Button' instead of ./components

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

Why it matters ​

Import from the direct path: import { Button } from './components/Button' instead of ./components

How to fix ​

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

Agent Guidance ​

Import from the module that defines the symbol, for example ./components/Button, instead of the folder index barrel, so unused exports can be tree-shaken.


Rule source: vue-doctor/bundle-size/no-barrel-import

Released under the MIT License.