My package.json file
{
"name": "aiky",
"version": "1.0.0",
"description": "Recipe application",
"default": "index.html",
"scripts": {
"start": "parcel index.html",
"build": "parcel build index.html --dist-dir ./dist"
},
"author": "Akash Kesharwani",
"license": "ISC",
"devDependencies": {
"@parcel/resolver-glob": "^2.0.0-rc.0",
"@parcel/transformer-image": "^2.0.0-rc.0",
"@parcel/transformer-sass": "^2.0.0-rc.0",
"parcel": "^2.0.0-rc.0",
"sass": "^1.26.10"
},
"dependencies": {
"core-js": "^3.6.5",
"fractional": "^1.0.0",
"regenerator-runtime": "^0.13.7"
},
"main": "index.js"
}
I can't find the solution over the internet. Before this, I was getting this error
@parcel/core: Failed to resolve 'src/img/test-1.jpg' from './index.html'
@parcel/resolver-default: Cannot load file './src/img/test-1.jpg' in './'.
So, I installed @parcel/resolver-glob and also added .parcelrc in root with this text
{
"extends": "@parcel/config-default",
"resolvers": ["@parcel/resolver-glob"]
}
It's not very obvious from the Parcel documentation, but you will need to include the default resolvers by adding the literal string "..." to the resolvers array.
The "..." syntax can be used to extend the default resolvers. This allows you to override the resolution for certain dependencies, but fall back to the default for others. Generally, you'll want to add your custom resolvers before running the default ones.
{
"extends": "@parcel/config-default",
"resolvers": ["@parcel/resolver-glob", "..."]
^^^^^
}