Last active
December 14, 2015 11:19
-
-
Save spencercarnage/5078168 to your computer and use it in GitHub Desktop.
require.js is loading the data-main script twice
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
<!DOCTYPE doctype 5> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> | |
<title></title> | |
<meta name="description" content=""/> | |
<meta name="viewport" content="width=device-width,initial-scale=1"/> | |
<script data-main="js/test" src="/js/libs/require-2.1.4.js"></script> | |
</head> | |
<body> | |
</body> | |
</html> | |
// test.js | |
require(['test1'], function (Test1) { | |
new Test1(); | |
console.log('test loaded'); | |
}); | |
// test1.js | |
define(function () { | |
return function () { | |
console.log('test 1 loaded'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment