Skip to content

Commit

Permalink
chore: update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunny-117 committed Jan 28, 2024
1 parent c4e34bd commit 0427e2d
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 139 deletions.
5 changes: 2 additions & 3 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ const r = (p: string) => resolve(__dirname, p);
// generateFileSidebar(r('../useForm'))
export default defineConfig({
base: "/blog/",
title: "blog",
title: "Sunny's blog",
description: "composition api form validator for vue",
// appearance: false,
lastUpdated: true,

markdown: {
// TODO
anchor: {},
toc: { level: [1, 2, 3] },
toc: { level: [1, 2, 3, 4] },
theme: {
light: "min-dark",
dark: "one-dark-pro",
Expand Down
54 changes: 24 additions & 30 deletions docs/.vitepress/defaultSidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,6 @@ export const defaultSidebar: DefaultTheme.Sidebar = [
},
],
},
{
text: "前端三件套",
collapsible: true,
items: [
{
text: "异步处理",
link: "/js/异步处理",
},
{
text: "代理与反射",
link: "/js/代理与反射",
},
{
text: "迭代器和生成器",
link: "/js/迭代器和生成器",
},
...hcConfig
],
},
{
text: "前端工程化",
collapsible: true,
Expand All @@ -41,14 +22,12 @@ export const defaultSidebar: DefaultTheme.Sidebar = [

{
text: `Vuejs ${vueConfig.length}篇`,
collapsed: true,
collapsible: true,
items: vueConfig,
},
{
text: `React ${reactConfig.length}篇`,
collapsible: true,
collapsed: true,
items: reactConfig,
},
{
Expand All @@ -61,25 +40,40 @@ export const defaultSidebar: DefaultTheme.Sidebar = [
],
},
{
text: "前端工具",
text: "前端三件套",
collapsible: true,
items: [
{
text: "前端 JavaScript 必会工具库合集",
link: "/fe-utils/js工具库",
text: "异步处理",
link: "/js/异步处理",
},
{
text: "你的前端开发小助手",
link: "/fe-utils/你的前端开发小助手",
text: "代理与反射",
link: "/js/代理与反射",
},
{
text: "专业前端工程师的浏览器收藏夹",
link: "/fe-utils/专业前端工程师的浏览器收藏夹",
text: "迭代器和生成器",
link: "/js/迭代器和生成器",
},
...hcConfig
],
},
{
text: "前端工具",
items: [
{
text: "Git",
link: "/fe-utils/git",
},
{
text: "前端 JavaScript 必会工具库合集",
link: "/fe-utils/js工具库",
}
],
},

{
text: "algorithm",
text: "算法",
collapsible: true,
items: [
{
Expand All @@ -89,7 +83,7 @@ export const defaultSidebar: DefaultTheme.Sidebar = [
],
},
{
text: "interview",
text: "面试系列",
collapsible: true,
items: [
{
Expand Down
2 changes: 1 addition & 1 deletion docs/.vitepress/dist
Submodule dist updated from 6a0d76 to 094462
8 changes: 2 additions & 6 deletions docs/.vitepress/engineer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ export default [
text: "前端性能优化方法论",
link: "/front-end-engineering/performance",
},
{
text: "Git",
link: "/front-end-engineering/git",
},
{
text: "webpack常用拓展",
link: "/front-end-engineering/webpack常用拓展",
Expand All @@ -20,8 +16,8 @@ export default [
link: "/front-end-engineering/jscompatibility",
},
{
text: "webpack5",
link: "/front-end-engineering/webpack5",
text: "webpack5 模块联邦",
link: "/front-end-engineering/webpack5-mf",
},
{
text: "pnpm原理",
Expand Down
8 changes: 0 additions & 8 deletions docs/front-end-engineering/git.md → docs/fe-utils/git.md
Original file line number Diff line number Diff line change
Expand Up @@ -554,14 +554,6 @@ $ git stash pop

## 参考资料

[https://git-scm.com/](https://git-scm.com/) Git 官网

[https://duyiedu.yuque.com/docs/share/1bd59630-97ac-478a-b903-8a51f3008113?#](https://duyiedu.yuque.com/docs/share/1bd59630-97ac-478a-b903-8a51f3008113?#)  《初识 Git》

[https://duyiedu.yuque.com/docs/share/a3d4320e-065c-4149-a872-9462525577bd?#](https://duyiedu.yuque.com/docs/share/a3d4320e-065c-4149-a872-9462525577bd?#) 《访问 github 慢,该咋整?》

[https://duyiedu.yuque.com/docs/share/76a98dd5-0b69-415a-a5fb-703745d8999b?#](https://duyiedu.yuque.com/docs/share/76a98dd5-0b69-415a-a5fb-703745d8999b?#)(密码:qqre)《Add SSH Key 公钥添加》

local(每一个人的计算机上面也有一个项目仓库)

配置用户名
Expand Down
7 changes: 0 additions & 7 deletions docs/fe-utils/专业前端工程师的浏览器收藏夹.md

This file was deleted.

10 changes: 0 additions & 10 deletions docs/fe-utils/你的前端开发小助手.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,63 +1,4 @@
# webpack 5

## top-level-await

`webpack5`现在允许在模块的顶级代码中直接使用`await`

```javascript
const resp = await fetch("http://www.baidu.com");
const jsonBody = await resp.json();
export default jsonBody;
```

目前,`top-level-await`还未成为正式标准,因此,对于`webpack5`而言,该功能是作为`experiments`发布的,需要在`webpack.config.js`中配置开启

```javascript
// webpack.config.js
module.exports = {
experiments: {
topLevelAwait: true,
},
};
```

## 打包体积优化

`webpack5`对模块的合并、作用域提升、`tree shaking`等处理更加智能

## 打包缓存开箱即用

`webpack4`中,需要使用`cache-loader`缓存打包结果以优化之后的打包性能

而在`webpack5`中,默认就已经开启了打包缓存,无须再安装`cache-loader`

默认情况下,`webpack5`是将模块的打包结果缓存到内存中,可以通过`cache`配置进行更改

```javascript
const path = require("path");

module.exports = {
cache: {
// 缓存类型,支持:memory、filesystem
type: "filesystem",
// 缓存目录,仅类型为 filesystem 有效
cacheDirectory: path.resolve(__dirname, "node_modules/.cache/webpack"),
},
};
```

> [关于`cache`的更多配置参考](https://webpack.docschina.org/configuration/other-options/#cache)

## 资源模块

`webpack4`中,针对资源型文件我们通常使用`file-loader``url-loader``raw-loader`进行处理

由于大部分前端项目都会用到资源型文件,因此`webpack5`原生支持了资源型模块

详见:[https://webpack.docschina.org/guides/asset-modules/](https://webpack.docschina.org/guides/asset-modules/)

## 模块联邦
# webpack5 模块联邦

在大型项目中,往往会把项目中的某个区域或功能模块作为单独的项目开发,最终形成「微前端」架构

Expand Down
6 changes: 0 additions & 6 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
---
next: ./vue-core/index
---

# Getting Started

这里就放一些自我介绍吧,先占个坑

## My Frontend Projects

### js-challenges
Expand Down
9 changes: 1 addition & 8 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: home
hero:
name: blog
name: Sunny's blog
text: 前端历险记
image:
src: /logo.jpeg
Expand All @@ -13,11 +13,4 @@ hero:
- theme: alt
text: View on GitHub
link: https://github.com/Sunny-117/blog
features:
- title: 🦾 高级前端进阶知识
details: 工程化,组件库,基础建设...
- title: 🏆 面试系列
details: 回答到极致的八股文,手写,算法最优解...
- title: 😍 程序员优雅地“创业”
details: ...
---

0 comments on commit 0427e2d

Please sign in to comment.