My index.html has the following scripts.
<script src="js/moment.js"></script>
<script src="js/moment-timezone-with-data.min.js"></script>
When I run the electron app, I get an Uncaught Error: Cannot find module 'moment'
. The timezone library seems unable to tell that I have included moment.js.
This does appear to be a problem with Electron, as doing the same thing in a regular HTML file structure leads to everything working fine.
EDIT: I have tried modifying my code in the following manner.
<script src="js/moment.js"></script>
<script onload="window.moment = require(__dirname+'/js/moment.js');" src="js/moment-timezone-with-data.min.js"></script>
This still does not appear to produce any results.