中文手册:http://www.itbaby.me/doc/parcel/
学习代码:https://github.com/xuhuihui/parcel
1.首先使用 Yarn 或 npm 安装 Parcel :
Yarn:
yarn global add parcel-bundler
npm:
npm install -g parcel-bundler
2.使用以下命令在你的项目目录中创建一个 package.json
文件:
yarn init -y
or
npm init -y
3.创建一个 index.html
和 index.js
文件,在index.html
引入 index.js
文件。
4.输入parcel index.html,运行成功。
5.重新修改页面结构,重启parcel index.html。
other.css
.title { text-align: center; color: red;}
index.css
@import './other.css'
实现效果