Commit d6398ae8 authored by rockyl's avatar rockyl

兼容混淆版本的引擎

parent 6e583a84
This diff is collapsed.
This diff is collapsed.
{"id":"engine","url":"engine.cba09e24bd26909e1a67685a889d4799f4c2597a.js"}
\ No newline at end of file
{ {
"name": "zeroing-engine", "name": "zeroing-engine",
"version": "0.1.0", "version": "0.1.0",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"types": "index.d.ts", "types": "index.d.ts",
"dependencies": { "dependencies": {
"color": "^3.1.2", "color": "^3.1.2",
"emoji-regex": "^8.0.0", "emoji-regex": "^8.0.0",
"howler": "^2.1.2", "howler": "^2.1.2",
"rollup-plugin-progress": "^1.1.2" "rollup-plugin-progress": "^1.1.2"
}, },
"devDependencies": { "devDependencies": {
"dts-bundle": "^0.7.3", "dts-bundle": "^0.7.3",
"dts-bundle-generator": "^4.3.0", "dts-bundle-generator": "^4.3.0",
"glob": "^7.1.6", "glob": "^7.1.6",
"rollup-plugin-commonjs": "^10.1.0", "rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-node-resolve": "^5.2.0", "rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-typescript": "^1.0.1", "rollup-plugin-typescript": "^1.0.1",
"rollup-plugin-typescript2": "^0.25.2", "rollup-plugin-typescript2": "^0.25.2",
"rollup-plugin-uglify": "^6.0.3", "rollup-plugin-uglify": "^6.0.3",
"typescript": "^2.7.2" "typescript": "^2.7.2"
}, },
"scripts": { "scripts": {
"declare": "node scripts/declare.js src/index.ts", "declare": "node scripts/declare.js src/index.ts",
"dev": "rollup -c -m -w", "dev": "rollup -c -m -w",
"build": "rollup -c -o dist/engine.js", "build": "rollup -c -o dist/engine.js",
"build:prod": "rollup -c -o dist/engine.js --environment BUILD:production", "build:prod": "rollup -c -o dist/engine.min.js --environment BUILD:production",
"preprocess": "node scripts/pre-process.js engine dist/engine.js", "preprocess:prod": "node scripts/pre-process.js engine dist/engine.min.js prod",
"build:upload": "rm -rf dist&&yarn build:prod && yarn preprocess && ali-oss-publish -c oss.config.js -e dist", "preprocess:debug": "node scripts/pre-process.js engine dist/engine.js",
"build:debug": "rm -rf dist&&yarn build && yarn preprocess && ali-oss-publish -c oss.config.js -e dist", "pack:prod": "yarn build:prod && yarn preprocess:prod",
"ts": "dts-bundle --name engine --main types/src/index.d.ts --out ../../dist/index.d.ts", "pack:debug": "yarn build && yarn preprocess:debug",
"token": "uglifyjs -m -c -o px-token.min.js px-token.js", "upload": "ali-oss-publish -c oss.config.js -e dist",
"dts": "dts-bundle-generator -o types.d.ts src/index.ts" "publish": "rm -rf dist && yarn pack:debug && yarn pack:prod && yarn upload",
}, "ts": "dts-bundle --name engine --main types/src/index.d.ts --out ../../dist/index.d.ts",
"author": "", "token": "uglifyjs -m -c -o px-token.min.js px-token.js",
"license": "ISC" "dts": "dts-bundle-generator -o types.d.ts src/index.ts"
},
"author": "",
"license": "ISC"
} }
...@@ -6,7 +6,7 @@ const crypto = require('crypto'); ...@@ -6,7 +6,7 @@ const crypto = require('crypto');
const fs = require('fs'); const fs = require('fs');
const path = require('path'); const path = require('path');
const [_, __, id, fileName] = process.argv; const [_, __, id, fileName, isProd] = process.argv;
const stream = fs.createReadStream(fileName); const stream = fs.createReadStream(fileName);
const fsHash = crypto.createHash('sha1'); const fsHash = crypto.createHash('sha1');
...@@ -26,10 +26,16 @@ function loadComplete(md5) { ...@@ -26,10 +26,16 @@ function loadComplete(md5) {
const newFileName = fileName.substr(0, extIndex + 1) + md5 + fileName.substr(extIndex); const newFileName = fileName.substr(0, extIndex + 1) + md5 + fileName.substr(extIndex);
fs.renameSync(fileName, newFileName); fs.renameSync(fileName, newFileName);
let manifest = { let manifest;
id, if (fs.existsSync('manifest.json')) {
url: path.basename(newFileName), manifest = JSON.parse(fs.readFileSync('manifest.json', 'utf-8'));
}; } else {
manifest = {
id,
};
}
manifest[isProd ? 'url' : 'url_dbg'] = path.basename(newFileName);
fs.writeFileSync('manifest.json', JSON.stringify(manifest)); fs.writeFileSync('manifest.json', JSON.stringify(manifest));
} }
This diff is collapsed.
...@@ -136,7 +136,8 @@ export class StackContainer extends Node { ...@@ -136,7 +136,8 @@ export class StackContainer extends Node {
let len = this.childNum; let len = this.childNum;
if (len <= 0) { if (len <= 0) {
return false; resolve(true);
return;
} }
let lastView = this.getChildAt(this.children.length - 1); let lastView = this.getChildAt(this.children.length - 1);
let view; let view;
...@@ -166,7 +167,8 @@ export class StackContainer extends Node { ...@@ -166,7 +167,8 @@ export class StackContainer extends Node {
let len = this.childNum; let len = this.childNum;
if (len <= 0) { if (len <= 0) {
return false; resolve(true);
return;
} }
let lastView = this.getChildAt(len - 1); let lastView = this.getChildAt(len - 1);
...@@ -223,4 +225,4 @@ export class StackContainer extends Node { ...@@ -223,4 +225,4 @@ export class StackContainer extends Node {
) )
}) })
} }
} }
\ No newline at end of file
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