We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
关键字:module exports require global
模块的设计思想,是尽量的静态化,使得 编译时 就能确定模块的依赖关系,以及输入和输出的变量
关键字:export import
CommonJS 和 AMD 模块,都只能在 运行时 确定这些东西
目前阶段,通过 Babel 转码,CommonJS 模块的require命令和 ES6 模块的import命令,可以写在同一个模块里面,但是最好不要这样做。 因为import在 静态解析 阶段执行,所以它是一个模块之中最早执行的。 下面的代码可能不会得到预期结果。
CommonJS
require命令
ES6
import
require('core-js/modules/es6.symbol'); // 运行时执行 require('core-js/modules/es6.promise'); // 运行时执行 import React from 'React'; // 静态解析(编译)时执行
两者不是一个概念的东西。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
CommonJS模块化规范
关键字:module exports require global
模块的设计思想,是尽量的静态化,使得 编译时 就能确定模块的依赖关系,以及输入和输出的变量
ES6模块化规范
关键字:export import
CommonJS 和 AMD 模块,都只能在 运行时 确定这些东西
目前阶段,通过 Babel 转码,
CommonJS
模块的require命令
和ES6
模块的import命令,可以写在同一个模块里面,但是最好不要这样做。因为
import
在 静态解析 阶段执行,所以它是一个模块之中最早执行的。下面的代码可能不会得到预期结果。
两者不是一个概念的东西。
The text was updated successfully, but these errors were encountered: