Commit cd489492 authored by wildfirecode's avatar wildfirecode

1

parent 2b1e9cf8
......@@ -12,8 +12,8 @@ let build = opts => {
return false;
}
const dist = path.join(process.cwd(), opts.BUILD_SKIN, 'bin-release')
rm(dist, err => {
if (err) throw err;
// rm(dist, err => {
// if (err) throw err;
let webpackConfig = prodConfig(opts);
var spinner = ora('building for production...\n');
spinner.start();
......@@ -44,7 +44,31 @@ let build = opts => {
shelljs.exec('dbtinypng -i bin-release/resource -o bin-release/resource && node publish.js');
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 => {
......@@ -138,6 +162,7 @@ let notinypng = opts => {
module.exports = {
build: build,
buildAssets: buildAssets,
notinypng: notinypng,
buildTS: buildTS,
buildEXML: buildEXML
......
......@@ -57,6 +57,10 @@ class DuibaGameBuild {
this.slicePath(skin);
buildObj.buildEXML(this.opts);
}
buildProdAssets(skin) {
this.slicePath(skin);
buildObj.buildAssets(this.opts);
}
/**
* 备份 把skins/下的所有文件复制到backup/下
......
......@@ -18,5 +18,5 @@
"webpack-dev-server": "^3.1.0",
"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