It is a matter of tradeoffs.
If you consume dist
of your packages, this means that in order to "apply" changes inside your package you need to build, then consume it in the app
.
Some even suggests to publish the package to the registry (public or private), this allows you more loose coupling between the app and the packages.
On the other hand, working on the src has "seem less" like advantages, but will require your app setup to support it, since it will be the one that compile the package's code.
Personally, I'm using the second method, my apps are consuming from the src
, and it was not so trivial to configure to since must of the tools are ignoring code from node_modules
by default (Like babel-loader, which will ignore transpilation of code inside node_modules
).
Most of my code was based on next-transpile-modules source code.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…