预备环境
nodejs
npm
1. yarn 安装
npm install -g yarn
2. nextjs 项目初始化
yarn add next react react-dom
3. 配置nextjs 项目
"scripts":{
"dev": "next",
"build": "next build",
"start": "next start"
}
4. 创建简单项目
mkdir pages
cd pages
touch index.js
// content
export default ()=> <div>this is the index page </div>
// run
yarm run dev
// ok 就是这么简单
5. 参考资料
https://yarnpkg.com/zh-Hans/docs/getting-started