Commit cd489492 authored by wildfirecode's avatar wildfirecode

1

parent 2b1e9cf8
...@@ -12,8 +12,8 @@ let build = opts => { ...@@ -12,8 +12,8 @@ let build = opts => {
return false; return false;
} }
const dist = path.join(process.cwd(), opts.BUILD_SKIN, 'bin-release') const dist = path.join(process.cwd(), opts.BUILD_SKIN, 'bin-release')
rm(dist, err => { // rm(dist, err => {
if (err) throw err; // if (err) throw err;
let webpackConfig = prodConfig(opts); let webpackConfig = prodConfig(opts);
var spinner = ora('building for production...\n'); var spinner = ora('building for production...\n');
spinner.start(); spinner.start();
...@@ -44,7 +44,31 @@ let build = opts => { ...@@ -44,7 +44,31 @@ let build = opts => {
shelljs.exec('dbtinypng -i bin-release/resource -o bin-release/resource && node publish.js'); shelljs.exec('dbtinypng -i bin-release/resource -o bin-release/resource && node publish.js');
shelljs.cd('..'); shelljs.cd('..');
}); });
}); // });
};
let buildAssets = opts => {
if (!opts.BUILD_SKIN) {
console.error('请输入需要构建的项目名称\n');
return false;
}
const dist = path.join(process.cwd(), opts.BUILD_SKIN, 'bin-release')
// rm(dist, err => {
// if (err) throw err;
var spinner = ora('building start...\n');
spinner.text = '正在生成TextureMerger proj\n';
spinner.start();
shelljs.cd(opts.BUILD_SKIN);
shelljs.exec('node autoMerger.js');
spinner.stop();
spinner.text = '正在编译exmls\n';
spinner.start();
shelljs.exec('egret publish');
console.log('编译exmls结束');
spinner.stop();
shelljs.exec('dbtinypng -i bin-release/resource -o bin-release/resource && node publish.js');
shelljs.cd('..');
// });
}; };
let buildTS = opts => { let buildTS = opts => {
...@@ -138,6 +162,7 @@ let notinypng = opts => { ...@@ -138,6 +162,7 @@ let notinypng = opts => {
module.exports = { module.exports = {
build: build, build: build,
buildAssets: buildAssets,
notinypng: notinypng, notinypng: notinypng,
buildTS: buildTS, buildTS: buildTS,
buildEXML: buildEXML buildEXML: buildEXML
......
...@@ -57,6 +57,10 @@ class DuibaGameBuild { ...@@ -57,6 +57,10 @@ class DuibaGameBuild {
this.slicePath(skin); this.slicePath(skin);
buildObj.buildEXML(this.opts); buildObj.buildEXML(this.opts);
} }
buildProdAssets(skin) {
this.slicePath(skin);
buildObj.buildAssets(this.opts);
}
/** /**
* 备份 把skins/下的所有文件复制到backup/下 * 备份 把skins/下的所有文件复制到backup/下
......
...@@ -18,5 +18,5 @@ ...@@ -18,5 +18,5 @@
"webpack-dev-server": "^3.1.0", "webpack-dev-server": "^3.1.0",
"webpack-merge": "^4.1.2" "webpack-merge": "^4.1.2"
}, },
"version": "0.0.16" "version": "0.0.17"
} }
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