简体   繁体   English

包裹 HTML 链接与 CSS 和 JS 文件不匹配

[英]Parcel HTML links don't match CSS and JS files

In the dist directory, the index.html file is linking to:在 dist 目录中,index.html 文件链接到:

<link rel="stylesheet" href="/style.1dc133ea.css">

When it should really be:当它真的应该是:

<link rel="stylesheet" href="./style.1dc133ea.css">

The same applies with my app.js file.这同样适用于我的 app.js 文件。 I can manually change this each time I save the html file, but it's super annoying.每次保存 html 文件时,我都可以手动更改它,但这非常烦人。 I've seen that the issue is fixed if the html, css and js files are all in the same folder, but this ruins a lot of my organisation, as I prefer to have separate folders for each language.我已经看到如果 html、css 和 js 文件都在同一个文件夹中,问题就得到了解决,但这会破坏我的很多组织,因为我更喜欢为每种语言设置单独的文件夹。

Delete ./ if is same folder.删除./如果是同一个文件夹。

You can also look HTML path docs here: https://www.w3schools.com/html/html_filepaths.asp您还可以在此处查看 HTML 路径文档: https://www.w3schools.com/html/html_filepaths.asp

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM