Skip to content

Support dynamic importsΒ #198

@cowwoc

Description

@cowwoc

I suspect this plugin might have a problem with dynamic imports. Given ThemeChooser.mts that contains:

const htmlAsString = await import("./ThemeChooser.html", {with: {type: "html"}}) as { default: string };

I get this esbuild output:

  target\classes\theme\ThemeChooser-QGTYAYZG.js    248.7kb
  target\classes\chunk-YEX2IMXM.js                   1.6kb
  target\classes\theme\ThemeChooser-R7JEJFRF.html    1.3kb
  target\classes\theme\ThemeChooser-YVQTYOLV.js      168b 

Looking on disk, ThemeChooser-QGTYAYZG.js is created and references ThemeChooser-YVQTYOLV.js but the latter file does not exist.

Do you have any idea why the file isn't being created? Maybe try adding a unit test for handling dynamic imports?

Metadata

Metadata

Assignees

No one assigned

    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