Skip to content

dynamic import with vars help #2221

@The-Code-Monkey

Description

@The-Code-Monkey

Hi There, loving the speed of esbuild but im having an issue with my dynamic import that has variables in it.

export const getIcon = (name: IconTypes) => {
  return lazy(() => import(`./icons/${name}`));
};

so the icons folder never gets generated in my repo so this fails, which breaks the icon component completely.

Is there any way to get this to import correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions