From 9d00113edbb52f6f3dd3588a372f44fc51ba0ebc Mon Sep 17 00:00:00 2001 From: ccweng Date: Wed, 9 Oct 2024 11:10:17 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20sidebar=E6=96=B0=E5=A2=9E=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E9=93=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/.vitepress/config.mts | 1 + docs/frontend/monorepo.md | 2 +- docs/frontend/pkg-manager.md | 32 +++++++++++++++++++++++++++++++- docs/frontend/toolchain.md | 1 + 4 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 docs/frontend/toolchain.md diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index 24112cd..45356e9 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -31,6 +31,7 @@ export default defineConfig({ { text: 'JS 事件循环机制', link: '/frontend/event-loop' }, { text: '工程化: JS 包管理器', link: '/frontend/pkg-manager' }, { text: '工程化: Monorepo', link: '/frontend/monorepo' }, + { text: '工程化: 构建工具链', link: '/frontend/toolchain' }, ] }, { diff --git a/docs/frontend/monorepo.md b/docs/frontend/monorepo.md index 7cf9784..4fd5cb6 100644 --- a/docs/frontend/monorepo.md +++ b/docs/frontend/monorepo.md @@ -1,4 +1,4 @@ -# Monorepo 最佳实践 +# 工程化:Monorepo 最佳实践 > 大仓究竟是什么东西? diff --git a/docs/frontend/pkg-manager.md b/docs/frontend/pkg-manager.md index 8f4512c..d381b77 100644 --- a/docs/frontend/pkg-manager.md +++ b/docs/frontend/pkg-manager.md @@ -1,5 +1,35 @@ -# 工程化之 JS 包管理器 +# 工程化:JS 包管理器 > 你真的懂 `node_module` 和 `package.json` 吗 +:::info 信息 🚧 施工中 +::: + +## 1. 包管理器 + +在工程化环境下,开发同学可能已经接触到一些编程语言的**包管理器**了,比如: + +- python:pip +- java:maven、gradle +- golang:go mod +- rust:cargo +- dart:dart pub + +直白的讲,包管理器就是一种软件工具,可以以一致的方式自动管理(包括安装、升级、配置、删除)项目所需要的**第三方依赖**。 + +回到前端开发工程化的语境,JavaScript 的包管理器就是: + +- npm +- yarn +- pnpm + +甚至还有更多,但本文只聚焦这三种包管理器。 + +为了方便展开和理解,在最开始让我们忘掉 `yarn` 和 `pnpm`,直接来看看 `npm` 到底解决了哪些问题。 + +## 2. npm + +## 3. yarn + +## 4. pnpm diff --git a/docs/frontend/toolchain.md b/docs/frontend/toolchain.md new file mode 100644 index 0000000..9aa45b4 --- /dev/null +++ b/docs/frontend/toolchain.md @@ -0,0 +1 @@ +# 工程化:构建工具链