Parceljs无法为产品正确捆绑?

时间:2019-11-02 16:44:24

标签: javascript parceljs

我正在测试parceljs,并且可以很好地进行开发。我有一个普通的CSS来更改背景颜色,还有一个非常简单的js文件只是为了查看它是否正常工作。

css

body {
background-color: lightblue;
}

js

document.getElementById('app').textContent = 'hey'

所以所有这些都在开发模式下工作。但是我在/dist/index.html上尝试了实时服务器,而我所看到的只是裸露的html。没有样式,脚本不会渲染。我还尝试了“宗地构建”命令。和同一件事。我该怎么办?

package.json

{
  "name": "parceltest1",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "dev": "parcel ./src/index.html",
    "build": "parcel build ./src/index.html"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "parcel-bundler": "^1.12.4"
  }
}
Failed to load resource: the server responded with a status of 404 (Not Found)
Refused to apply style from 'http://127.0.0.1:5500/src.e31bb0bc.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled

0 个答案:

没有答案