【发布时间】:2020-11-02 22:22:08
【问题描述】:
我正在学习 Parcel,并尝试捆绑一个与 index.js 连接的 index.html。 localhost:1234 包裹上一切正常,但在 dist 文件夹中,当我打开 index.html 时,应用程序无法正常工作。
注意:我知道问题是由于在我的 index.js 中使用 import 引起的
我的 package.json 文件 -
{
"name": "reddit",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/core": "^7.10.4",
"cssnano": "^4.1.10"
},
"description": ""
}
My index.html code for script connect
importing redditapi.js in index.js(check the all folder list image)
The error I am getting when I try to use the APP on index.html from dist folder
【问题讨论】:
标签: javascript npm babeljs node-modules parceljs