Nodejs typically use require() to refer to functions categorized by files in modular form.
For the above correspondence, all functions of the complexly invoked Base application must be given a module name.
Is it possible to access the files in the above configuration without the module name?node.js
The easiest way to access a split file without a module name is to make it one file before running it in Node.js.
If you are using HTML as follows,
In the npm script, you can combine them into one file as follows:
Also, in nodo.js10, import/export on ES6 is Experimental, but it works.For example,
As , when you run it, add
--experimental-modules to the options.
© 2022 OneMinuteCode. All rights reserved.