Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path mappings not applied for re-exports #32

Open
danishcake opened this issue Mar 16, 2018 · 2 comments
Open

Path mappings not applied for re-exports #32

danishcake opened this issue Mar 16, 2018 · 2 comments

Comments

@danishcake
Copy link

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
@fathyb
Copy link
Owner

fathyb commented Mar 16, 2018

This has been fixed in the dev version (parcel-plugin-typescript@next), could you try it?

if(ts.isExportDeclaration(node)) {
return ts.updateExportDeclaration(node, decorators, modifiers, node.exportClause, literal)
}
else {
return ts.updateImportDeclaration(node, decorators, modifiers, node.importClause, literal)
}

@bsander
Copy link

bsander commented Aug 9, 2018

@fathyb This seems to be broken again currently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants