Skip to content

Commit 5ee39e7

Browse files
committed
update
1 parent 5faf0b0 commit 5ee39e7

7 files changed

Lines changed: 26 additions & 21 deletions

File tree

bin/index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,8 @@
3939
<!--用户自定义顺序文件添加到这里-->
4040
<!--jsfile--Custom-->
4141
<script src="./LayaAdapter.js"></script>
42-
<script src="./js/GameMain.js"></script>
4342
<script>
44-
require(['./GameMain']);
43+
require(['./js/GameMain']);
4544
</script>
4645
<!--jsfile--Custom-->
4746
<!--自定义的js(src文件夹下)文件自动添加到下面jsfile模块标签里面里-->

bin/js/Foo.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
define(["require", "exports", "./getColor", "LayaAdapter"], function (require, exports, getColor_1, LayaAdapter_1) {
2+
"use strict";
3+
Object.defineProperty(exports, "__esModule", { value: true });
4+
var Foo = (function () {
5+
function Foo() {
6+
var hello = new LayaAdapter_1.Text();
7+
hello.text = 'Hello LayaAir';
8+
hello.fontSize = 20;
9+
hello.color = getColor_1.getColor();
10+
Laya.stage.addChild(hello);
11+
}
12+
return Foo;
13+
}());
14+
exports.Foo = Foo;
15+
});

bin/js/GameMain.js

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,4 @@
1-
define("Foo", ["require", "exports", "LayaAdapter"], function (require, exports, LayaAdapter_1) {
2-
"use strict";
3-
Object.defineProperty(exports, "__esModule", { value: true });
4-
var Foo = (function () {
5-
function Foo() {
6-
var hello = new LayaAdapter_1.Text();
7-
hello.text = 'Hello LayaAir';
8-
hello.fontSize = 20;
9-
hello.color = '#ffffff';
10-
Laya.stage.addChild(hello);
11-
}
12-
return Foo;
13-
}());
14-
exports.Foo = Foo;
15-
});
16-
define("GameMain", ["require", "exports", "Foo"], function (require, exports, Foo_1) {
1+
define(["require", "exports", "./Foo"], function (require, exports, Foo_1) {
172
"use strict";
183
Object.defineProperty(exports, "__esModule", { value: true });
194
// 程序入口

bin/js/getColor.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
define(["require", "exports"], function (require, exports) {
2+
"use strict";
3+
Object.defineProperty(exports, "__esModule", { value: true });
4+
exports.getColor = function () { return '#ff0000'; };
5+
});

src/Foo.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
import { getColor } from './getColor';
12
import { Text } from 'LayaAdapter';
23
export class Foo {
34
constructor() {
45
const hello = new Text();
56
hello.text = 'Hello LayaAir';
67
hello.fontSize = 20;
7-
hello.color = '#ffffff';
8+
hello.color = getColor();
89
Laya.stage.addChild(hello);
910
}
1011
}

src/getColor.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const getColor = () => '#ff0000';

tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
"sourceMap": false,
55
"module": "amd",
66
"skipLibCheck": true,
7-
"outDir": "./bin/js",
8-
"outFile": "./bin/js/GameMain.js"//,
7+
"outDir": "./bin/js"
98
// "watch": true
109
},
1110
"experimentalDecorators": true,

0 commit comments

Comments
 (0)