我正在尝试使用Pug和多个入口点设置包裹。我已经梳理过through the docs,但无法弄清楚自己在做什么错。现在,我有两个主要问题:
about.html
中,而不在index.html
中加载CSS。about.pug
应该构建为about/index.html
。如何将哈巴狗文件构建到各自的文件夹中:page/index.html
?项目结构:
src
├── js
│ └── index.js
├── pug
│ ├── about.pug
│ ├── index.pug
│ └── layouts
│ └── default.pug
└── styles
└── main.scss
about.pug
和index.pug
都在src/layouts/default.pug
中使用默认布局。
将SCSS
文件导入到index.js
中,如下所示:
import "../styles/main.scss";
但是由于某些原因,CSS在构建时仅导入about.html
而不是index.html
中。
这是我的package.json
构建脚本:
"scripts": {
"start": "parcel src/pug/*.pug",
"build": "parcel build src/pug/*.pug"
}
如果您想看一下,这里是一个仓库:github repository