Commit ce8afae0 authored by rockyl's avatar rockyl

增加自定义模块支持

parent 0b63ae5e
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
"scripts": { "scripts": {
"build-webpack": "webpack", "build-webpack": "webpack",
"rollup": "rollup -c", "rollup": "rollup -c",
"rename": "node scripts/rename-hash.js dist/index.js", "rename": "node scripts/rename-hash.js dist/engine.js",
"build": "yarn rollup && yarn rename", "build": "yarn rollup && yarn rename",
"ts": "dts-bundle --name engine --main types/src/index.d.ts --out ../../dist/index.d.ts", "ts": "dts-bundle --name engine --main types/src/index.d.ts --out ../../dist/index.d.ts",
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
......
...@@ -12,7 +12,7 @@ export default { ...@@ -12,7 +12,7 @@ export default {
input: 'src/index.ts', input: 'src/index.ts',
output: [ output: [
{ {
file: `dist/index.js`, file: `dist/engine.js`,
format: 'umd', format: 'umd',
name: 'engine', name: 'engine',
sourcemap: true, sourcemap: true,
......
...@@ -92,7 +92,9 @@ export class GameStage extends Container { ...@@ -92,7 +92,9 @@ export class GameStage extends Container {
let total = assets.length; let total = assets.length;
if (customs) { if (customs) {
for (let custom of customs) { for (let custom of customs) {
total += custom.assets.length; if(custom.assets){
total += custom.assets.length;
}
} }
} }
...@@ -100,7 +102,9 @@ export class GameStage extends Container { ...@@ -100,7 +102,9 @@ export class GameStage extends Container {
await loadAssets(assets, p); await loadAssets(assets, p);
if (customs) { if (customs) {
for (let custom of customs) { for (let custom of customs) {
await loadAssets(custom.assets, p); if(custom.assets){
await loadAssets(custom.assets, p);
}
} }
} }
hideLoadingView(); hideLoadingView();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment