[英]Server running error in parcel by starting the external file index.html I Ignoring the main but it also doesn't work(Build Failed)
[Build Error in parcel @ 2.7.0 start when I am trying to add external index.html file in the main I also ignored the main but it also doesn't work for me. [当我尝试在主文件中添加外部 index.html 文件时,包裹@ 2.7.0 开始构建错误我也忽略了主文件,但它对我也不起作用。 Will please someone help me to solve this problem It also not working with JavaScript file when I added externally and also getting error with html file but I want to add the html file but as a solution I try to add JavaScript file but it also doesn't work for me.
Will please someone help me to solve this problem It also not working with JavaScript file when I added externally and also getting error with html file but I want to add the html file but as a solution I try to add JavaScript file but it also doesn'不适合我。 Will please someone solve this issue or tell me how to solve this issue
请有人解决这个问题或告诉我如何解决这个问题
{
"name": "forkify",
"version": "1.0.0",
"description": "",
"main": "unrelated.js",
"targets": {
"main": false
},
"scripts": {
"start": "parcel start index.html",
"build": "parcel build index.html"
},
"author": "Meelad Sultan",
"license": "ISC",
"devDependencies": {
"parcel": "^2.7.0"
}
}
enter code here
At last I can find the solution of my problem after almost a day if someone else facing the same problem they just do add the **Browsers list ** in the package.json file before script and ignore the main target and also set the parcel to latest then the parcel will run successfully and do not give any server error or build error.最后我可以在几乎一天后找到我的问题的解决方案,如果其他人面临同样的问题,他们只是在脚本之前的package.json文件中添加**浏览器列表**并忽略主要目标并设置包裹到最近,包裹将成功运行,并且不会出现任何服务器错误或构建错误。 And don't forget to run periodically npx browerlist@latest --update-db.
并且不要忘记定期运行npx browerlist@latest --update-db。 It will update your package-lock file with new caniuse-lite version.
它将使用新的 caniuse-lite版本更新您的包锁定文件。 In this case, you will be sure that last two version or > 0.2% will target what you expect { "name": "forkify", "version": "1.0.0", "description": "", "main": "unrelated.js", "target": { "main": false }, "browserslist": "> 0.5%, last 2 versions, not dead", "scripts": { "start": "parcel index.html " }, "author": "Meelad Sultan", "license": "ISC", "devDependencies": { "@parcel/transformer-sass": "^2.7.0", "parcel": "latest" }, "dependencies": { "sass": "^1.55.0" } }
在这种情况下,您将确定最后两个版本或> 0.2%将针对您所期望的 { "name": "forkify", "version": "1.0.0", "description": "", "main" : "unrelated.js", "target": { "main": false }, "browserslist": "> 0.5%,最后 2 个版本,未死", "scripts": { "start": "parcel index.html " }, "author": "Meelad Sultan", "license": "ISC", "devDependencies": { "@parcel/transformer-sass": "^2.7.0", "parcel": "latest" }, “依赖”:{“sass”:“^1.55.0”}}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.