Skip to content

@swc/plugin-loadable-components doesn't support aliased loadable imports #572

@karmeleon

Description

@karmeleon

Describe the bug
According to the Loadable docs, the loadable() function should be transformed by the plugin regardless of where it's imported from. Internally we vendor @loadable/component to support some extra features our infra requires; the Babel plugin transforms it successfully while the swc plugin ignores it.

Minimal reproduction

import loadable from 'my-vendored-loadable';

loadable(() => import('./SomeComponent'));

Expected behavior
The first argument of any imported function named loadable should be transformed in accordance to the Loadable spec.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions