wclr / yalc

Work with yarn/npm packages locally like a boss.
MIT License
5.64k stars 147 forks source link

Import statements not resolving when using `yalc link` #222

Open AllenAttuned opened 1 year ago

AllenAttuned commented 1 year ago

Environment:

This might be more of an IDE or Node.js issue, but it's stumped me for a while.

As stated in the docs, when using yalc link a symlink is created in the project's node_modules directory which points to the project's .yalc/<some lib> directory. For my situation, this works great as I do not want to modify the project's package.json file.

The issue I'm having is withimport statements and type definitions. import statements do resolve, so this might be a pure IDE issue, but if instead of "linking" the Yalc dependency I use yalc add, the aforementioned issues don't occur.

This is the build process that I'm following:

build:
    npx tspc
    NODE_ENV=${env} npx babel src \
    --out-dir ${output_dir} \
    --extensions '.ts','.js','.tsx','.jsx' \

local_pub: clean_build
local_pub:
    npx yalc publish
    npx yalc push
    cd ${yalc_global_package_path} && \
        npm install