<!-- Insert this line above script imports  -->
<script>if (typeof module === 'object') {window.module = module; module = undefined;}</script>

<!-- normal script imports etc  -->
<script src="scripts/jquery.min.js"></script>    
<script src="scripts/vendor.js"></script>    

<!-- Insert this line after script imports -->
<script>if (window.module) module = window.module;</script>

Benefits

  • Works for both browser and electron with the same code
  • Fixes issues for ALL 3rd-party libraries (not just jQuery) without having to specify each one
  • Script Build / Pack Friendly (i.e. Grunt / Gulp all scripts into vendor.js)
  • Does NOT require node-integration to be false

source here

相关文章:

  • 2022-12-23
  • 2021-07-11
  • 2021-09-04
  • 2022-12-23
  • 2021-12-25
  • 2021-05-07
  • 2021-10-08
  • 2021-12-04
猜你喜欢
  • 2022-12-23
  • 2021-11-17
  • 2021-10-06
  • 2021-08-04
  • 2021-08-29
  • 2021-07-13
  • 2022-12-23
相关资源
相似解决方案