-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex-amd.html
32 lines (28 loc) · 957 Bytes
/
index-amd.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<html>
<head></head>
<body>
<button onclick="AppModule.renderDateString()">Show current year</button>
<!-- Renders to this container -->
<p id="date-string-container"></p>
<!-- If you omit type="module", browser complains: "Uncaught SyntaxError: Cannot use import statement outside a module" -->
<script src="node_modules/requirejs/require.js"></script>
<!-- see https://requirejs.org/docs/api.html#config -->
<script>
require.config({
// baseUrl: "/another/path",
paths: {
"module-demo": "build/umd",
"lodash": "./node_modules/lodash/lodash"
}
});
require( ["module-demo/main"],
function(someModule, myModule) {
//This function will be called when all the dependencies
//listed above are loaded. Note that this function could
//be called before the page is loaded.
//This callback is optional.
}
);
</script>
</body>
</html>