CommonJS —— 第三方,基于node,浏览器端没有
导入:require
导出:module.exports 和 exports
- module.exports = {} 导出一个对象
- exports 是module.exports的一个引用,最终的调用还是exports
ES6
导入:import
导出:export 和 export defalut
两者的区别
export defalut导出只有一个
export可以导出多个
导入方式defalut直接导入,export可以通过解构的方式