Import problem in ES6 Grammar

there is a utils folder in the root directory that contains index.js. Do I reference import utils from". / utils" in the entry file is tantamount to referencing the index.js file inside? if there are many other files, how is it referenced?

Apr.16,2022

first referencing a folder automatically references the following index.js, which is not a standard for ES6 import, but an implementation of nodejs's module system. So different module loaders can have different implementations for referencing a folder path, such as webpack,browserify follows the convention of nodejs.

it is also possible to refer to other files under the path, such as package.json,index.json...

clipboard.png

for more information on Node module loading algorithm, please see https://nodejs.org/api/module...

.

find utils.js first, and if not, find utils/index.js


the first floor talked about the import mechanism. If you have multiple files, you will import multiple times

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bf0bee-462b1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bf0bee-462b1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?