Compilation 在编译jade文件并希望保持相对路径正确时,如何编写gulp文件?

Compilation 在编译jade文件并希望保持相对路径正确时,如何编写gulp文件?,compilation,gulp,pug,relative-path,Compilation,Gulp,Pug,Relative Path,我想要的是将update.jade(在srcdir下)编译成update.html(在distdir下)style.css在src和dist目录下是相同的。当我编译该文件时,我发现指向*.css文件的链接没有更改,因此页面无法正确显示。它应该是“css/style.css”,而不是“../../css/style.css” 我的目录结构如下 以下是相关的玉石档案 布局。jade doctype html html(lang='en') include incl/head.jade bod

我想要的是将update.jade(在srcdir下)编译成update.html(在distdir下)style.css在src和dist目录下是相同的。当我编译该文件时,我发现指向*.css文件的链接没有更改,因此页面无法正确显示。它应该是“css/style.css”,而不是“../../css/style.css”

我的目录结构如下

以下是相关的玉石档案

布局。jade

doctype html
html(lang='en')
  include incl/head.jade
  body
head
  meta(charset='utf-8')/
  title Update
  link(href='../../css/style.css', rel='stylesheet')/
extends templates/layout.jade
block content
  div#main
头.玉

doctype html
html(lang='en')
  include incl/head.jade
  body
head
  meta(charset='utf-8')/
  title Update
  link(href='../../css/style.css', rel='stylesheet')/
extends templates/layout.jade
block content
  div#main
update.jade

doctype html
html(lang='en')
  include incl/head.jade
  body
head
  meta(charset='utf-8')/
  title Update
  link(href='../../css/style.css', rel='stylesheet')/
extends templates/layout.jade
block content
  div#main
但是,生成的update.html文件仍然保留了style.css文件的旧引用URL路径,这使我不知所措

生成的update.html

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Update</title>
    <link href="../../css/style.css" rel="stylesheet">