Commit b97bd485 authored by rockyl's avatar rockyl

提交收尾

parent 7730c34f
......@@ -4,6 +4,7 @@
"main": "index.js",
"license": "MIT",
"dependencies": {
"rollup-plugin-commonjs": "^10.0.1",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-typescript": "^1.0.1",
"rollup-plugin-uglify": "^6.0.2",
......
......@@ -3,19 +3,32 @@
*/
const resolve = require('rollup-plugin-node-resolve');
const commonjs = require('rollup-plugin-commonjs');
const typescript = require('rollup-plugin-typescript');
const {uglify} = require('rollup-plugin-uglify');
const name = 'Main';
const name = 'scilla-engine';
export default {
input: 'src/Main.ts',
input: 'src/index.ts',
output: [
{
file: `dist/bundle.js`,
file: `dist/index.cjs.js`,
format: 'cjs',
},
{
file: `dist/index.es.js`,
format: 'es',
},
{
file: `dist/scilla-engine.js`,
format: 'umd',
name,
},
{
file: `dist/index.js`,
format: 'umd',
name,
sourcemap: true,
}
],
plugins: [
......@@ -25,8 +38,8 @@ export default {
typescript({
typescript: require('typescript'),
tslib: require('tslib'),
declaration: false,
}),
//uglify(),
commonjs(),
//uglify({}),
]
};
......@@ -5,7 +5,7 @@
import {IBridge, IEntity} from "scilla";
import {implementLifecycle} from "./entity-proxy";
import {launch} from "./launcher";
import {clean, launch} from "./launcher";
export * from './entities'
......@@ -28,4 +28,8 @@ export class Bridge implements IBridge{
launch(options?) {
launch(options);
}
cleanRoot() {
clean();
}
}
......@@ -8,11 +8,13 @@ import {Stage} from "../2d/display/Stage";
import {RENDERER_TYPE, StageScaleMode} from "../2d/const";
import Container from "../2d/display/Container";
let stage, container;
export function launch(options?) {
let stage = new Stage("cusEngine", 750, 1206, 60, StageScaleMode.FIXED_WIDTH, RENDERER_TYPE.CANVAS);
stage = new Stage("cusEngine", 750, 1206, 60, StageScaleMode.FIXED_WIDTH, RENDERER_TYPE.CANVAS);
Stage.flushAll(0);
stage.addEventListener(Event.INIT_TO_STAGE, () => {
var container = new Container();
container = new Container();
stage.addChild(container)
container.y = stage.viewRect.y;
......@@ -24,3 +26,9 @@ export function launch(options?) {
scene.setup();
});
}
export function clean(){
if(container){
container.removeChildren();
}
}
......@@ -18,6 +18,11 @@
esutils "^2.0.2"
js-tokens "^4.0.0"
"@types/estree@0.0.39":
version "0.0.39"
resolved "https://registry.npm.taobao.org/@types/estree/download/@types/estree-0.0.39.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Festree%2Fdownload%2F%40types%2Festree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f"
integrity sha1-4Xfmme4bjCLSMXTKqnQiZEOJUJ8=
"@types/node@*":
version "12.6.2"
resolved "https://registry.npm.taobao.org/@types/node/download/@types/node-12.6.2.tgz#a5ccec6abb6060d5f20d256fb03ed743e9774999"
......@@ -103,6 +108,13 @@ is-module@^1.0.0:
resolved "https://registry.npm.taobao.org/is-module/download/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591"
integrity sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=
is-reference@^1.1.2:
version "1.1.3"
resolved "https://registry.npm.taobao.org/is-reference/download/is-reference-1.1.3.tgz#e99059204b66fdbe09305cfca715a29caa5c8a51"
integrity sha1-6ZBZIEtm/b4JMFz8pxWinKpcilE=
dependencies:
"@types/estree" "0.0.39"
isarray@~1.0.0:
version "1.0.0"
resolved "https://registry.npm.taobao.org/isarray/download/isarray-1.0.0.tgz?cache=0&sync_timestamp=1562592096220&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fisarray%2Fdownload%2Fisarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
......@@ -121,6 +133,13 @@ js-tokens@^4.0.0:
resolved "https://registry.npm.taobao.org/js-tokens/download/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
integrity sha1-GSA/tZmR35jjoocFDUZHzerzJJk=
magic-string@^0.25.2:
version "0.25.3"
resolved "https://registry.npm.taobao.org/magic-string/download/magic-string-0.25.3.tgz#34b8d2a2c7fec9d9bdf9929a3fd81d271ef35be9"
integrity sha1-NLjSosf+ydm9+ZKaP9gdJx7zW+k=
dependencies:
sourcemap-codec "^1.4.4"
merge-stream@^1.0.1:
version "1.0.1"
resolved "https://registry.npm.taobao.org/merge-stream/download/merge-stream-1.0.1.tgz#4041202d508a342ba00174008df0c251b8c135e1"
......@@ -151,13 +170,24 @@ readable-stream@^2.0.1:
string_decoder "~1.1.1"
util-deprecate "~1.0.1"
resolve@^1.10.0, resolve@^1.11.1:
resolve@^1.10.0, resolve@^1.11.0, resolve@^1.11.1:
version "1.11.1"
resolved "https://registry.npm.taobao.org/resolve/download/resolve-1.11.1.tgz#ea10d8110376982fef578df8fc30b9ac30a07a3e"
integrity sha1-6hDYEQN2mC/vV434/DC5rDCgej4=
dependencies:
path-parse "^1.0.6"
rollup-plugin-commonjs@^10.0.1:
version "10.0.1"
resolved "https://registry.npm.taobao.org/rollup-plugin-commonjs/download/rollup-plugin-commonjs-10.0.1.tgz#fbfcadf4ce2e826068e056a9f5c19287d9744ddf"
integrity sha1-+/yt9M4ugmBo4Fap9cGSh9l0Td8=
dependencies:
estree-walker "^0.6.1"
is-reference "^1.1.2"
magic-string "^0.25.2"
resolve "^1.11.0"
rollup-pluginutils "^2.8.1"
rollup-plugin-node-resolve@^5.2.0:
version "5.2.0"
resolved "https://registry.npm.taobao.org/rollup-plugin-node-resolve/download/rollup-plugin-node-resolve-5.2.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Frollup-plugin-node-resolve%2Fdownload%2Frollup-plugin-node-resolve-5.2.0.tgz#730f93d10ed202473b1fb54a5997a7db8c6d8523"
......@@ -209,6 +239,11 @@ source-map@~0.6.1:
resolved "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
integrity sha1-dHIq8y6WFOnCh6jQu95IteLxomM=
sourcemap-codec@^1.4.4:
version "1.4.6"
resolved "https://registry.npm.taobao.org/sourcemap-codec/download/sourcemap-codec-1.4.6.tgz#e30a74f0402bad09807640d39e971090a08ce1e9"
integrity sha1-4wp08EArrQmAdkDTnpcQkKCM4ek=
string_decoder@~1.1.1:
version "1.1.1"
resolved "https://registry.npm.taobao.org/string_decoder/download/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8"
......
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