exports和module.exports的区别

module.exports返回的是一个{}

expoerts是对module.exports的一个引用;

即:

module.exports = {

  abc: ‘abc’

};

exports.hehe = ‘hehe’;

等价于:

module.exports = {

  abc: ‘abc’,

  hehe: ‘hehe’

}

原文地址:https://www.cnblogs.com/hellobajie/p/8624851.html