# v3-write **Repository Path**: kgm0515/v3-write ## Basic Information - **Project Name**: v3-write - **Description**: 手写vue3 - **Primary Language**: TypeScript - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-07-04 - **Last Updated**: 2022-02-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # v3-write #### 介绍 手写 vue3 #### Vue3 项目结构 1. reactivity:响应式系统 2. runtime-core:与平台无关的运行时核心 (可以创建针对特定平台的运行时 - 自定义渲染器) 3. runtime-dom: 针对浏览器的运行时。包括 DOM API,属性,事件处理等 4. runtime-test:用于测试 5. server-renderer:用于服务器端渲染 6. compiler-core:与平台无关的编译器核心 7. compiler-dom: 针对浏览器的编译模块 8. compiler-ssr: 针对服务端渲染的编译模块 9. compiler-sfc: 针对单文件解析 10. size-check:用来测试代码体积 11. template-explorer:用于调试编译器输出的开发工具 12. shared:多个包之间共享的内容 13. vue:完整版本,包括运行时和编译器 #### 初始化 1. yarn init -y #### 安装依赖 - npm install typescript rollup rollup-plugin-typescript2 @rollup/plugin-node-resolve @rollup/plugin-json execa -D - yarn add typescript rollup rollup-plugin-typescript2 @rollup/plugin-node-resolve @rollup/plugin-json execa --ignore-workspace-root-check - typescript 支持 typescript - rollup 打包工具 - rollup-plugin-typescript2 rollup 和 ts 的 桥梁 - @rollup/plugin-node-resolve 解析 node 第三方模块 - @rollup/plugin-json 支持引入 json - execa 开启子进程方便执行命令 #### 添加一个包对另一个包的依赖 - yarn workspace @vue/reactivity add @vue/shared@1.0.1