Skip to content

Commit

Permalink
use webpack with express
Browse files Browse the repository at this point in the history
  • Loading branch information
gasolin committed Feb 22, 2016
1 parent 8112101 commit ff564c3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/robot.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ var EnterMessage = ref1.EnterMessage;
var LeaveMessage = ref1.LeaveMessage;
var TopicMessage = ref1.TopicMessage;
var CatchAllMessage = ref1.CatchAllMessage;
// var Middleware = require('./middleware');
var Middleware = Object;
var Middleware = require('./middleware');

console.log('Hello webby!');

Expand Down
15 changes: 14 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
var path = require('path');
var fs = require('fs');
var nodeModules = {};
fs.readdirSync('node_modules')
.filter(function(x) {
return ['.bin'].indexOf(x) === -1;
})
.forEach(function(mod) {
nodeModules[mod] = 'commonjs ' + mod;
});

module.exports = {
name: 'server',
target: 'node',
entry: './index.js',
output: {
path: __dirname,
filename: 'bin/webby.js'
},
target: 'node',
externals: nodeModules,
module: {
loaders: [{
test: /\.js$/,
Expand Down

0 comments on commit ff564c3

Please sign in to comment.