I utilize [email protected]. Whenever I attempt to load an external css or javascript file in my index.html, Parcel consistently fails to build with the following error:
Build failed.
@parcel/core: Failed to resolve './css/main.css' from './src/index.html'*
@parcel/resolver-default: Cannot load file '../../../../../css/main.css' in './src'.
Here is the Code
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Parcel V2 Tutorial</title>
<link rel="stylesheet" href="./css/main.css">
</head>
<body>
<h1>Hello</h1>
</body>
</html>
main.css
body{
background: cyan;
}
package.json
{
"name": "parceltutorial",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "parcel src/index.html"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@parcel/resolver-glob": "^2.7.0",
"parcel": "^2.7.0"
}
}
I have also installed @parcel/resolver-glob and configured my .parcelrc like so:
{
"extends": "@parcel/config-default",
"resolvers": ["@parcel/resolver-glob", "..."]
}
I have attempted removing my .parcel-cache as per suggestions from others, but the error persists. Thank you 🙏