The JS packages should be stored in /node_modules (like Ruby gems are stored in /bundle) rather than in the codebase node_modules sub-directory.
This would avoid ignoring node_modules in docker-sync.yml and wouldn't pollute the host filesystem.
We need to tell Yarn to use /node_modules as modules folder for every Yarn command (as suggested in this issue). The following configuration line in .yarnrc is supposed to do exactly that:
--*.modules-folder "/node_modules"
Unfortunately, not all Yarn commands seem to honour this configuration and it seems to break the .bin folder, it sometimes wipes out node_modules completely, ...
This issue is kept open in order to follow progress on this matter.
ℹ️ The following (unscoped) shorthand is supposed to be the exact equivalent:
--modules-folder "/node_modules"
Unfortunately - once again - it seems still unsure whether it's actually behaving exactly equivalently or not 😕
ℹ️ Setting NODE_PATH to the same custom folder seems to be a good idea to support some legacy behaviour:
env:
NODE_PATH "/node_modules"
When all those issues have been worked around, we may be able to improve and merge the code in the use-absolute-node_modules-folder branch 🤷♂️
The JS packages should be stored in
/node_modules(like Ruby gems are stored in/bundle) rather than in the codebasenode_modulessub-directory.This would avoid ignoring
node_modulesindocker-sync.ymland wouldn't pollute the host filesystem.We need to tell Yarn to use
/node_modulesas modules folder for every Yarn command (as suggested in this issue). The following configuration line in.yarnrcis supposed to do exactly that:Unfortunately, not all Yarn commands seem to honour this configuration and it seems to break the
.binfolder, it sometimes wipes outnode_modulescompletely, ...This issue is kept open in order to follow progress on this matter.
When all those issues have been worked around, we may be able to improve and merge the code in the use-absolute-node_modules-folder branch 🤷♂️