中文手册:www.itbaby.me/doc/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'复制代码
实现效果