内容简介:When you have projects depend on each other. You have to build core first, then the project depends on it and so on. You probably want this step to be automated so you can use:This project is licensed under the
Package Sorter
A function used for monorepos production build.
When you have projects depend on each other. You have to build core first, then
the project depends on it and so on. You probably want this step to be automated
so you can use: package-sorter(unsortedPackages, coreDependency)
.
npm install package-sorter
Example:
import packageSorter from "package-sorter"; // packages in your monorepo: const pkg0 = { name: "@folo/withcontext", dependencies: {} }; const pkg1 = { name: "@folo/values", dependencies: { "@folo/withcontext": "^0.1.5" } }; const pkg2 = { name: "@folo/utils", dependencies: {} }; const pkg3 = { name: "@folo/layout", dependencies: { "@folo/withcontext": "^0.1.5" } }; const pkg4 = { name: "@folo/forms", dependencies: { "@folo/layout": "^0.1.4", "@folo/values": "^0.1.4" } }; const unsortedPackages = [pkg1, pkg2, pkg3, pkg0, pkg4]; // our core dependency in this case is: @folo. const sorted = sortPackages(unsortedPackages, "@folo"); //=> [pkg2, pkg0, pkg1, pkg4, pkg3]
Tests
npm test
License
This project is licensed under the GPL-3.0 License
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
腾讯网UED体验设计之旅
任婕 等 / 电子工业出版社 / 2015-4 / 99.00元
《腾讯网UED体验设计之旅》是腾讯网UED的十年精华输出,涵盖了丰富的案例、极富冲击力的图片,以及来自腾讯网的一手经验,通过还原一系列真实案例的幕后设计故事,从用户研究、创意剖析、绘制方法、项目管理等实体案例出发,带领读者经历一场体验设计之旅。、 全书核心内容涉及网媒用户分析与研究方法、门户网站未来体验设计、H5技术在移动端打开的触控世界、手绘原创设计、改版迭代方法、文字及信息图形化设计、媒......一起来看看 《腾讯网UED体验设计之旅》 这本书的介绍吧!