Skip to content

Commit

Permalink
Add main proc build to package.js
Browse files Browse the repository at this point in the history
  • Loading branch information
jhen0409 committed Apr 10, 2016
1 parent 286010f commit 52b5d6b
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions package.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

const os = require('os');
const webpack = require('webpack');
const electronCfg = require('./webpack.config.electron.js');
const cfg = require('./webpack.config.production.js');
const packager = require('electron-packager');
const del = require('del');
Expand Down Expand Up @@ -53,11 +54,20 @@ if (version) {
}


function build(cfg) {
return new Promise((resolve, reject) => {
webpack(cfg, (err, stats) => {
if (err) return reject(err);
resolve(stats);
});
});
}

function startPack() {
console.log('start pack...');
webpack(cfg, (err, stats) => {
if (err) return console.error(err);
del('release')
build(electronCfg)
.then(() => build(cfg))
.then(() => del('release'))
.then(paths => {
if (shouldBuildAll) {
// build for all platforms
Expand All @@ -77,7 +87,6 @@ function startPack() {
.catch(err => {
console.error(err);
});
});
}

function pack(plat, arch, cb) {
Expand Down

0 comments on commit 52b5d6b

Please sign in to comment.