-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
55 lines (45 loc) · 1.15 KB
/
test.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>arenaless bundler test running</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<script type="module">
import "https://esm.sh/fast-text-encoding/text.min.js"
import { build } from "./dist/index.js";
let files_text = {
"index.coffee": `# Assignment:
number = 42
opposite = true
# Conditions:
number = -42 if opposite
# Functions:
square = (x) -> x * x
# Arrays:
list = [1, 2, 3, 4, 5]
# Objects:
math =
root: Math.sqrt
square: square
cube: (x) -> x * square x
# Splats:
race = (winner, runners...) ->
print winner, runners
# Existence:
alert "I knew it!" if elvis?
# Array comprehensions:
cubes = (math.cube num for num in list)`,
}
let files = {};
for (let key in files_text) {
files[key] = new TextEncoder().encode(files_text[key]);
}
build(files, "index.coffee", "{}", console, "cjs", "{}", false).then((res)=>{
console.log(res);
})
</script>
</body>
</html>