Skip to content

Move JS packages away from codebase #1

@michaelbaudino

Description

@michaelbaudino

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 🤷‍♂️

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions