Directory 将pug includes设置为不编译

Directory 将pug includes设置为不编译,directory,pug-loader,Directory,Pug Loader,我正在运行帕格CLI 帕格src——出网——观看 如果我有 src/ index.pug includes/ scripts.pug web/ index.html (generated) 在index.pug中:include includes/scripts.pug 使用此设置,如果我修改scripts.pug,它会生成我不需要的web/includes/scripts.html,我也不想这样做,以保持整洁 有没有办法避免编译某些文件/目录? (目前的一个解决

我正在运行帕格CLI

帕格src——出网——观看

如果我有

src/
   index.pug 
   includes/
      scripts.pug
web/
  index.html (generated)
在index.pug中:
include includes/scripts.pug

使用此设置,如果我修改scripts.pug,它会生成我不需要的web/includes/scripts.html,我也不想这样做,以保持整洁

有没有办法避免编译某些文件/目录?
(目前的一个解决办法是将includes设置为html格式,但也许有办法)

在文件中添加下划线前缀应该告诉帕格不要直接编译它们。这对于仅用作包含的文件非常有用

因此,您应该将
scripts.pug
重命名为
\u scripts.pug

src/
  index.pug 
  includes/
    _scripts.pug
web/
  index.html (generated)

然后将
index.pug
中的
include
语句重写为:
include/\u scripts.pug

确定吗?我接受了答案,但直到现在才进行测试,似乎不起作用。据我所见,必须安装一个特定的pug-cli2。它适用于
gulp pug
包,但对于其他工具可能有所不同。