esbuild-plugin-import-glob icon indicating copy to clipboard operation
esbuild-plugin-import-glob copied to clipboard

Usage with TypeScript

Open stolinski opened this issue 3 years ago • 3 comments

Have you had any issues using this with TS? I'm getting

 > import-glob:./**/*:2:305: error: Could not resolve "startAPI.ts" (mark it as external to exclude it from the bundle)
    2 │ ...s.ts';import * as module6 from 'startAPI.ts'
      ╵                                   ~~~~~~~~~~~~~

When trying to use for the first time. I can provide a better reproduction if you'd like, on ESBuild 0.11.12

stolinski avatar Apr 18 '21 18:04 stolinski

I've found a solution to my issue, but I'd like to present it to you here first before making a pr. The import string on https://github.com/thomaschaaf/esbuild-plugin-import-glob/blob/d13aa20635b219a944e811938ff29d42b1238b95/src/index.ts#L30

Needed to be import * as module${index} from './${module}' otherwise, it would tell me that it can't find import whatever from 'file.ts' rather than './file.ts'

LMK what you think.

stolinski avatar Apr 18 '21 20:04 stolinski

Seeing the same issue here :)

Intrepidd avatar Sep 06 '21 07:09 Intrepidd

Same one here.

hasparus avatar Dec 23 '21 19:12 hasparus