Skip to content
Advertisement

Tag: commonjs

import menu to browser window by “require” function

I am working on a electron demo by following this tutorial. just wondering what happened in the require line of code. ./menu/mainmenu.js defines the menu items. main.js does the require(‘./menu/mainmenu’) copy whole file into main.js? Or imported some modules? In the mainmenu.js file There is no export keyword. according to the node.js documentation, “The basic functionality of require is that

How can I ‘require’ CommonJS modules in the browser? [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 2 years ago. Improve this question What is the best way to load CommonJS modules as client-side JavaScript code in the browser? CommonJS modules put their functionality

Advertisement