Skip to content

Commit 5faf0b0

Browse files
committed
update
1 parent 33ad8c1 commit 5faf0b0

7 files changed

Lines changed: 14 additions & 30 deletions

File tree

bin/LayaAdapter.js

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

bin/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@
3838
<!-- 物理引擎matter.js -->
3939
<!--用户自定义顺序文件添加到这里-->
4040
<!--jsfile--Custom-->
41+
<script src="./LayaAdapter.js"></script>
4142
<script src="./js/GameMain.js"></script>
4243
<script>
43-
require(['./GameMain'],function(){});
44+
require(['./GameMain']);
4445
</script>
4546
<!--jsfile--Custom-->
4647
<!--自定义的js(src文件夹下)文件自动添加到下面jsfile模块标签里面里-->

bin/js/Foo.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

bin/js/GameMain.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
define("Foo", ["require", "exports", "./Laya"], function (require, exports, Laya_1) {
1+
define("Foo", ["require", "exports", "LayaAdapter"], function (require, exports, LayaAdapter_1) {
22
"use strict";
33
Object.defineProperty(exports, "__esModule", { value: true });
44
var Foo = (function () {
55
function Foo() {
6-
var hello = new Laya_1.Text();
6+
var hello = new LayaAdapter_1.Text();
77
hello.text = 'Hello LayaAir';
88
hello.fontSize = 20;
99
hello.color = '#ffffff';

bin/libs/laya.core.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19574,14 +19574,4 @@ var Laya=window.Laya=(function(window,document){
1957419574

1957519575
new LayaMain();
1957619576

19577-
})(window,document,Laya);
19578-
19579-
if (typeof define === "function" && define.amd)
19580-
{
19581-
define('Laya', ["require", "exports"], function (require, exports) {
19582-
"use strict";
19583-
Object.defineProperty(exports, "__esModule", { value: true });
19584-
exports.Text = Laya.Text;
19585-
});
19586-
}
19587-
19577+
})(window,document,Laya);

libs/LayaAdapter.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
declare module "LayaAdapter" {
2+
export const Text: typeof Laya.Text;
3+
}

src/Foo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Text } from './Laya';
1+
import { Text } from 'LayaAdapter';
22
export class Foo {
33
constructor() {
44
const hello = new Text();

0 commit comments

Comments
 (0)