Skip to content

Maybe decouple global package.json file #23

@OmeGak

Description

@OmeGak

This is clearly early optimization and not necessary at the moment, but I've been thinking about it and I prefer to dump my thoughts and leads here.

All sites share the same package.json file at the moment. This makes sense, since all sites use the same npm scripts and depend on the same devPackages. With #22, however, one site will need a prod package that the other doesn't. This, however, is not really a problem. Packages won't be bundled by WebPack unless they are explicitly imported when processing JS files.

In case this becomes really necessary at some point, there are two strategies we can take:

  1. Each site maintains its own package.json. While trivial to implement, it will lead to divergencies between sites. Not only in prod and dev packages that we may want to have available in all sites, but also in npm scripts.
  2. Using hierarchical package.json. Ideal, as we could define common properties in one file and extend from it. Unfortunately, npm doesn't support this and we would need to use another tool like dry or builder (system dependency).

Metadata

Metadata

Assignees

No one assigned

    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