0
点赞
收藏
分享

微信扫一扫

vuepress----1、快速开始

创建项目工程 本文会帮助你从头搭建一个简单的 VuePress 文档。如果你想在一个现有项目中使用 VuePress 管理文档,从步骤 3 开始。

创建并进入一个新目录

mkdir vuepress-starter && cd vuepress-starter 1 使用你喜欢的包管理器进行初始化

yarn init # npm init 1 将 VuePress 安装为本地依赖

我们已经不再推荐全局安装 VuePress

yarn add -D vuepress # npm install -D vuepress 1 注意

如果你的现有项目依赖了 webpack 3.x,我们推荐使用 Yarn (opens new window)而不是 npm 来安装 VuePress。因为在这种情形下,npm 会生成错误的依赖树。

创建你的第一篇文档

mkdir docs && echo '# Hello VuePress' > docs/README.md 1 在 package.json 中添加一些 scripts(opens new window)

这一步骤是可选的,但我们推荐你完成它。在下文中,我们会默认这些 scripts 已经被添加。

{ "scripts": { "docs:dev": "vuepress dev docs", "docs:build": "vuepress build docs" } } 1 2 3 4 5 6 在本地启动服务器

yarn docs:dev # npm run docs:dev 1 VuePress 会在 http://localhost:8080 (opens new window)启动一个热重载的开发服务器。

举报

相关推荐

0 条评论