RTVision / esbuild-dynamic-import

Plugin for transform dynamic imports in esbuild
17 stars 5 forks source link

Better docs needed struggling to implement #1

Closed The-Code-Monkey closed 2 years ago

The-Code-Monkey commented 2 years ago

so im trying to implement this and i cant seem to works it out

const result = await esbuild.buildSync({
              ...inputOptions,
              plugins: [
                DynamicImport({ changeRelativeToAbsolute: true })
              ]
            });

and its saying that DynamicImport is not a function

kalvenschraut commented 2 years ago

Don't know why I am not getting notifications for issues so sorry for the late response.

If this is still an issue does the below comment help you?

// note depending on your setup you may need to do DynamicImport.default() instead

Meaning if DynamicImport is not a function, is DynamicImport.default a function instead?