Skip to content

About the author of Daydream Drift

Tomasz Niezgoda (LinkedIn/tomaszniezgoda & GitHub/tniezg) is the author of this blog. It contains original content written with care.

Please link back to this website when referencing any of the materials.

Author:

Alternative to `npm link`

Published

npm link sucks. It doesn't work in Docker and it doesn't work with a lot of projects. Symlinking JavaScript projects often makes Webpack and other build tools unable to properly resolve npm packages required by the linked project when building the parent project. Here's an alternative, albeit very primitive, solution:

chokidar /projects/my-custom-website-theme -c 'rsync -avz /projects/my-custom-website-theme /projects/website/src/themes/'

It uses Chokidar CLI and rsync to copy all files from /projects/my-custom-website-theme to a /themes directory in a parent project whenever they change.