parcel-plugin-typescript icon indicating copy to clipboard operation
parcel-plugin-typescript copied to clipboard

Path mappings not applied for re-exports

Open danishcake opened this issue 6 years ago • 2 comments

Given tsconfig.json similar to

{
  "compilerOptions": {
    "baseUrl": "src",
    "paths": {
      "@src/*": ["./*"]
    }
}

This works:

// src/index.ts
import {some_enum} from '@src/some_enum';
import {some_class} from '@src/some_class';
export {some_enum, some_class};

This does not work:

export * from '@src/some_enum'
export * from '@src/some_class'

Bug looks to be in backend/transformers/paths.ts

....if (ts.isImportDeclaration(child)) { // This returns false, but we need to engage in name mangling here

danishcake avatar Mar 16 '18 15:03 danishcake

This has been fixed in the dev version (parcel-plugin-typescript@next), could you try it? https://github.com/fathyb/parcel-plugin-typescript/blob/8aeb184642193db8f7312e8c3c453c4d25959bfd/src/backend/transformers/paths.ts#L55-L60

fathyb avatar Mar 16 '18 16:03 fathyb

@fathyb This seems to be broken again currently.

bsander avatar Aug 09 '18 07:08 bsander