This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define('moduleA',function(require, exports, module){ | |
require('moduleB'); | |
exports.A = 1 | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define('moduleB', [], function(require, exports, module){ | |
exports.B = 1 | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script type="text/javascript" src="sea.js"></script> | |
<script type="text/javascript" src="seajsconfig.js"></script> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
seajs.use(['moduleA'], function(moduleA){ | |
console.log(moduleA) | |
}) |