Blogger Information
Blog 28
fans 0
comment 2
visits 52092
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
关于js import 一个文件夹自动导入index.js文件
耶和华信徒的博客
Original
1023 people have browsed it

这是一个node的特性,node 引入一个包或者文件的时候会在相对于package.json 同级的node_moudles文件夹下找对应的文件夹组件,如果没有找到会到上一级直至全局都没有才抛出未找到组件。
找到对应的组件后如果组件内没有package.json文件将会默认使用index.js 如果package.json文件,将会根据package.json下的main配置项找哦到对应的组件入口文件

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post