- CommonJs: Node.js
- AMD: require.js
- CMD: sea.js
- ES6
javascript
{
// 导出
export let A = 123
export function test() {
console.log('test')
}
export class Hello {
test() {
console.log('class')
}
}
}
{
let A = 123
let test = function () {
console.log('test')
}
class Hello {
test() {
console.log('class')
}
}
export default {
A,
test,
Hello,
}
}
// 小技巧
// import * as modules from "../../xxx"
// console.log(moudlex.xxx);