0

"scripts":{"start": "parcel docs/demo_world.html"}package.json ファイルの Parcel スクリプトを使用して、jQuery maphilight プラグインのデモを実行しようとしています。https://github.com/kemayo/maphilightからダウンロードした maphilight デモ プロジェクトを使用しています。これは、ライブ サーバーを使用して正常に動作しますが、上記の Parcel スクリプトを使用すると、開発ツールで次のエラーが発生します。ここに画像の説明を入力

上記のリンクで maphilight デモを取得し、実行npm i parcel-bundler --save-devして、以下の package.json ファイルにスクリプトを追加しました。

これはParcelでも可能ですか?どんな情報でも大歓迎です!ありがとうございました。

完全な package.json は次のようになります。

{
  "name": "maphilight",
  "version": "1.4.2",
  "title": "maphilight",
  "author": {
    "name": "David Lynch",
    "email": "kemayo@gmail.com",
    "url": "http://davidlynch.org"
  },
  "repository": "https://github.com/kemayo/maphilight.git",
  "licenses": [
    {
      "type": "MIT",
      "url": "MIT-LICENSE.txt"
    }
  ],
  "dependencies": {
    "jquery": "^3.0.0"
  },
  "scripts": {
    "start": "parcel docs/demo_world.html",
    "build": "parcel build docs/demo_world.html --public-url.",
    "build:archive": "ch5-cli archive -p npm_practice_v1 -d dist -o output"
  },
  "description": "a plugin that adds visual hilights to image maps",
  "keywords": [
    "map",
    "imagemap",
    "hilight",
    "highlight",
    "jquery-plugin",
    "ecosystem:jquery"
  ],
  "homepage": "https://github.com/kemayo/maphilight",
  "main": "jquery.maphilight.min.js",
  "devDependencies": {
    "grunt": "^1.0.4",
    "grunt-contrib-jshint": "^2.1.0",
    "grunt-contrib-uglify": "^4.0.1",
    "grunt-contrib-watch": "^1.1.0",
    "parcel-bundler": "^1.12.5"
  }
}

HTML:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>jQuery maphilight documentation</title>
    <script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
    <script type="text/javascript" src="../jquery.maphilight.min.js"></script>
    <script type="text/javascript">$(function() {
        $('.map').maphilight({fade: false});
    });</script>
</head>
<body>...

</body>
</html>
4

0 に答える 0