Skip to content

Commit

Permalink
[docs] Update Webpack server example (#2976)
Browse files Browse the repository at this point in the history
  • Loading branch information
darrachequesne authored Jun 15, 2017
1 parent 410f5bc commit bf7afb1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 28 deletions.
3 changes: 2 additions & 1 deletion examples/webpack-build-server/lib/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

const server = require('http').createServer();
const io = require('socket.io')(server, {
// serveClient: false // do not serve the client file, in that case the brfs loader is not needed
serveClient: false,
wsEngine: 'ws' // uws is not supported since it is a native module
});
const port = process.env.PORT || 3000;

Expand Down
12 changes: 2 additions & 10 deletions examples/webpack-build-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,8 @@
},
"author": "Damien Arrachequesne",
"license": "MIT",
"dependencies": {
"brfs": "^1.4.3",
"bufferutil": "^1.3.0",
"socket.io": "^1.7.2",
"transform-loader": "^0.2.3",
"utf-8-validate": "^2.0.0"
},
"devDependencies": {
"json-loader": "^0.5.4",
"null-loader": "^0.1.1",
"webpack": "^1.14.0"
"socket.io": "^2.0.3",
"webpack": "^2.6.1"
}
}
18 changes: 1 addition & 17 deletions examples/webpack-build-server/support/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,7 @@ module.exports = {
entry: './lib/index.js',
target: 'node',
output: {
path: './dist',
path: require('path').join(__dirname, '../dist'),
filename: 'server.js'
},
module: {
loaders: [
{
test: /(\.md|\.map)$/,
loader: 'null'
},
{
test: /\.json$/,
loader: 'json'
},
{
test: /\.js$/,
loader: "transform-loader?brfs"
}
]
}
};

0 comments on commit bf7afb1

Please sign in to comment.