-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoptimizer.html
39 lines (39 loc) · 946 Bytes
/
optimizer.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
33
34
35
36
37
38
39
<!DOCTYPE html>
<html>
<head>
<meta charset="utf8">
<style>
textarea {
width: 100%;
height: 20em;
}
</style>
<script src="js/r.js"></script>
<script src="js/require.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function (evt) {
require(['src/config'], function(config) {
config.out = function (text) {
document.getElementById('output').value = text;
};
document.getElementById('build').addEventListener('click', function (evt) {
requirejs.optimize( config, function (buildText) {
document.getElementById('buildMessages').value = buildText;
});
}, false);
});
}, false);
</script>
</head>
<body>
<h1>r.js in the browser</h1>
<p>A test of running r.js in the browser.</p>
<p>
<button id="build">Build it</button>
</p>
<h2>Build Messages</h2>
<textarea id="buildMessages"></textarea>
<h2>Output</h2>
<textarea id="output"></textarea>
</body>
</html>