Require myself util.js fail


#1
++++ html
     ----index.html
++++ js
     ----index.js
     ----util.js

look at the file struct. in the index.html. i add script src="…/js/index.js", in index.js, i add require(’./util.js’). but when i run the cmd ‘electron .’, it shows the error. cannot find the module ‘util.js’. what’s wrong? how can i require util.js


#2

Use <script>require('../js/index.js')</script>.