After making modifications to an npm package and using yarn link <project name>
locally, everything works perfectly. However, when pushing it to GitHub and trying to add it to the project with
yarn add <repo url>#<branch>
instead of yarn link
, a compilation error arises, indicating that the TypeScript/ES6 code has not been compiled:
SyntaxError Plugin: Unexpected token *
This error specifically points to the line in the added package:
import * as path from 'path'
The question remains: How can I make yarn add
compile the TypeScript/ES6 code on-the-fly from the GitHub version, similar to how yarn link
handles the local version?
I would prefer to avoid building and committing the compiled results to git, as that introduces an extra compilation step every time, which could potentially be overlooked by myself or others.
To clarify, I am not publishing these changes to npm, as this involves a forked package that is not owned by me.