前端模块化开发

1、模块化规范CommonJS、AMD、CMD、Modules(ES6)。

2、CommonJS

  1. 导出:module.exports = {}
  2. 导入:require()

3、ES6模块化:

  1. 导出:export {}
  2. 导出:export var name = ''
  3. 导出:export function name() {}
  4. 导入:import {} from ''
  5. 导入全部:import * as aaa from ''

posted on 2021-07-08 10:15  代码改变世界001  阅读(65)  评论(0)    收藏  举报

导航