想了解更深,可看阮一峯大神的解釋ES6node
module.exports = function fn() {}和var fn = require'./index'是相對對應的es6
module.exports = function fn() {}
var fn = require'./index'
export default function () {}和import fn from './index'是對應的的模塊化
export default function () {}
import fn from './index'