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:
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.
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).
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 samenpm
scripts and depend on the samedevPackages
. 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:
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 innpm
scripts.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 likedry
orbuilder
(system dependency).