$ npm i --save bmaplib.heatmap
<script src="//unpkg.com/bmaplib.heatmap"></script>
import Heatmap from 'bmaplib.heatmap'
// You should use this lib after BaiduMap loaded. For Example:
loadBaiduMap.then(() => {
new Heatmap()
})
<script src="//api.map.baidu.com/api?v=2.0"></script>
<script src="//unpkg.com/bmaplib.heatmap"></script>
<script>
new BMapLib.Heatmap()
</script>