Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component must be imported with defineAsyncComponent #2597

Open
dmitryuk opened this issue Nov 5, 2024 · 0 comments
Open

Component must be imported with defineAsyncComponent #2597

dmitryuk opened this issue Nov 5, 2024 · 0 comments

Comments

@dmitryuk
Copy link

dmitryuk commented Nov 5, 2024

Some declared components separated to a custom webpack chunk and must be used with defineAsyncComponent and dynamic import:

// GOOD
const Tooltip = defineAsyncComponent({
    loader: () => import('../../components/Tooltip/Tooltip.vue'),
    hydrate: hydrateOnVisible(),
});

How to make a rule to prevent direct import? Because it will include the component to main chunk

// BAD
 import Tooltip from '../../components/Tooltip/Tooltip.vue';
@dmitryuk dmitryuk changed the title Component must be used with defineAsyncComponent Component must be imported with defineAsyncComponent Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant