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

fix Babel transform to handle TS type annotations #64

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Jan 5, 2022

  1. fix Babel transform to handle TS type annotations

    The `@babel/plugin-transform-modules-commonjs` transform runs before the esbuild step, which is where TS type annotations are removed.
    
    This can cause files that contain typings to fail with errors like:
    
    ```
    SyntaxError: xxx.ts: Cannot transform the imported binding "XXX" since it's also used in a type annotation. Please strip type annotations using @babel/preset-typescript or @babel/preset-flow.
    ```
    
    This commit ensures that files that are transformed via this Babel plugin have their type annotations removed via the `@babel/preset-typescript` preset beforehand.
    
    Fixes aelbore#57
    petebacondarwin committed Jan 5, 2022
    Configuration menu
    Copy the full SHA
    61e3f62 View commit details
    Browse the repository at this point in the history