【问题标题】:How do you access a file mapped in manifest.json in an html file?如何访问 html 文件中 manifest.json 中映射的文件?
【发布时间】:2020-07-07 09:12:36
【问题描述】:

所以我有一个生成的清单文件如下,

{
  "0.0eaa8ffc6b248ee016ed.bundle.js": "test/public/dist/0.0eaa8ffc6b248ee016ed.bundle.js",
  "1.7e194c6ac39e9447bead.bundle.js": "test/public/dist/1.7e194c6ac39e9447bead.bundle.js",
  "2.20766d436d451349eca2.bundle.js": "test/public/dist/2.20766d436d451349eca2.bundle.js",
  "index.js": "site/public/dist/index.96a6be838d583dae3962.bundle.js",
}

我想在我的 index.html 中指定这个 index.js 文件的哈希文件

<script src="test/public/dist/index.js"></script>

如何在我的 html 文件中访问这个文件?

【问题讨论】:

  • 我也试过 。还是不行

标签: html reactjs manifest.json


【解决方案1】:

你应该寻找类似于this Webpack plugin 的东西来达到这个目的。

您永远不应手动导入名称中包含哈希的输出文件。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-06-29
    • 1970-01-01
    • 1970-01-01
    • 2015-09-30
    • 2013-05-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多