Skip to content

Commit

Permalink
fix various build pipeline details
Browse files Browse the repository at this point in the history
  • Loading branch information
hartym committed Apr 13, 2016
1 parent eed56c0 commit ab26514
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
27 changes: 18 additions & 9 deletions bin/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,32 @@
* LICENSE.txt file in the root directory of this source tree.
*/

import webpack from 'webpack';
import webpackConfig from '../config/webpack';
import webpack from 'webpack'
import webpackClientConfig from '../config/webpack/client'
import webpackServerConfig from '../config/webpack/server'
import logStats from './lib/log-stats'

/**
* Creates application bundles from the source files.
*/
function bundle() {
function bundle () {
return new Promise((resolve, reject) => {
webpack(webpackConfig).run((err, stats) => {
webpack(webpackClientConfig).run((err, stats) => {
if (err) {
return reject(err);
return reject(err)
}
logStats('webpack/browser', stats);

console.log(stats.toString(webpackConfig[0].stats));
return resolve();
});
});
webpack(webpackServerConfig).run((err2, stats2) => {
if (err2) {
return reject(err2)
}
logStats('webpack/server', stats2)

return resolve()
})
})
})
}

export default bundle;
3 changes: 2 additions & 1 deletion config/webpack/loaders/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ export default {
include: [
path.resolve(__dirname, '../../../src'),
path.resolve(__dirname, '../../../config'),
path.resolve(__dirname, '../../../test')
path.resolve(__dirname, '../../../test'),
path.resolve(__dirname, '../../../build/assets')
],
query: {
// https://github.com/babel/babel-loader#options
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"express": "^4.13.4",
"font-awesome": "^4.5.0",
"isomorphic-fetch": "^2.1.1",
"morgan": "^1.7.0",
"pretty-error": "^2.0.0",
"react": "^15.0.1",
"react-dom": "^15.0.1",
Expand Down

0 comments on commit ab26514

Please sign in to comment.