Commit a8d8ef69 authored by wildfirecode's avatar wildfirecode

1

parent accff8cc
...@@ -94,9 +94,51 @@ let buildEXML = opts => { ...@@ -94,9 +94,51 @@ let buildEXML = opts => {
}); });
}; };
let notinypng = 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;
let webpackConfig = prodConfig(opts);
var spinner = ora('building for production...\n');
spinner.start();
// 构建
webpack(webpackConfig, function (err, stats) {
spinner.stop();
if (err) throw err;
process.stdout.write(
stats.toString({
colors: true,
modules: false,
children: false,
chunks: false,
chunkModules: false
}) + '\n\n'
);
console.log(chalk.cyan('Build complete.\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('node publish.js');
shelljs.cd('..');
});
});
};
module.exports = { module.exports = {
build: build, build: build,
notinypng: notinypng,
buildTS: buildTS, buildTS: buildTS,
buildEXML: buildEXML buildEXML: buildEXML
}; };
...@@ -43,6 +43,10 @@ class DuibaGameBuild { ...@@ -43,6 +43,10 @@ class DuibaGameBuild {
this.slicePath(skin); this.slicePath(skin);
buildObj.build(this.opts); buildObj.build(this.opts);
} }
notinypng(skin) {
this.slicePath(skin);
buildObj.notinypng(this.opts);
}
buildProdTS(skin) { buildProdTS(skin) {
this.slicePath(skin); this.slicePath(skin);
......
...@@ -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.13" "version": "0.0.14"
} }
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