Having submodules in the same repo as a parent application seems
like a great idea, and using file:<module-path> in the top-level
dependencies section supports this. However, we experience an
"unflattening" of modules after we install an individual module by
name.
node version: v4.2.1
npm version: 3.3.12
_______________________________
< First: do a plain npm install >
-------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
npm-install-submodule-behaviour@0.0.1 /Users/jonathona/Code/npm-install-submodule-behaviour
βββ¬ react@0.14.2
β βββ¬ envify@3.4.0
β β βββ¬ jstransform@10.1.0
β β β βββ base62@0.1.1
β β β βββ esprima-fb@13001.1001.0-dev-harmony-fb
β β β βββ¬ source-map@0.1.31
β β β βββ amdefine@1.0.0
β β βββ through@2.3.8
β βββ¬ fbjs@0.3.2
β βββ core-js@1.2.6
β βββ¬ loose-envify@1.1.0
β β βββ js-tokens@1.0.2
β βββ¬ promise@7.0.4
β β βββ asap@2.0.3
β βββ ua-parser-js@0.7.9
β βββ whatwg-fetch@0.9.0
βββ submodule1@0.0.1
βββ submodule2@0.0.1
________________
< React Count: 1 >
----------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
___________________________________
< Second: install submodule by name >
-----------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
react@0.14.2 node_modules/react -> node_modules/submodule1/node_modules/react
npm-install-submodule-behaviour@0.0.1 /Users/jonathona/Code/npm-install-submodule-behaviour
βββ¬ submodule1@0.0.1
β βββ react@0.14.2
βββ¬ submodule2@0.0.1
βββ react@0.14.2
________________
< React Count: 2 >
----------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
___________________________________
/ Finish up with: another plain npm \
\ install /
-----------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
npm-install-submodule-behaviour@0.0.1 /Users/jonathona/Code/npm-install-submodule-behaviour
βββ react@0.14.2
βββ¬ submodule1@0.0.1
β βββ react@0.14.2
βββ¬ submodule2@0.0.1
βββ react@0.14.2
________________
< React Count: 3 >
----------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||