akiran / akiran/react-highlight

Highlight.js Dependency Breaks Webpack Builds

未关闭
#65 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
761
派生
82
PR 合并指标
30 天内没有已合并 PR

描述

Hello, we started getting build and deployment failures that I traced to this package. An example error is one such as below:

```
ERROR in 33-chunk-ad7e81b972059fad92fe.js from UglifyJs
Unexpected token: keyword (const) [./node_modules/highlight.js/lib/languages/reasonml.js:36,0][33-chunk-ad7e81b972059fad92fe.js:18860,2]
```

This is because the highlight.js package recently introduced code using `const`, which breaks UglifyJS: https://github.com/highlightjs/highlight.js/commit/1c7046919a0aa09eab11a205f480dd5a15c05ce6.

I fixed this for my team's purposes by forking this repo and setting highlight.js to version 9.11.0:
https://github.com/drewmoore/react-highlight/blob/9eb2b4cdab046fda8317e6ca03ab0483b9a955ff/package.json#L28

I would be happy to submit a PR if you would like. This issue has been reported on the highlight.js repo at https://github.com/highlightjs/highlight.js/issues/1871

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。