From 6c08cfa2676d4f136b1a7ad020d6a642cefaa55b Mon Sep 17 00:00:00 2001 From: Damien Arrachequesne Date: Thu, 15 Jun 2017 23:40:43 +0200 Subject: [PATCH] =?UTF-8?q?[docs]=C2=A0Update=20Webpack=20server=20example?= =?UTF-8?q?=20(#2976)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/webpack-build-server/lib/index.js | 3 ++- examples/webpack-build-server/package.json | 12 ++---------- .../support/webpack.config.js | 18 +----------------- 3 files changed, 5 insertions(+), 28 deletions(-) diff --git a/examples/webpack-build-server/lib/index.js b/examples/webpack-build-server/lib/index.js index afcdbdb8a4..b05f4fbbbb 100644 --- a/examples/webpack-build-server/lib/index.js +++ b/examples/webpack-build-server/lib/index.js @@ -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; diff --git a/examples/webpack-build-server/package.json b/examples/webpack-build-server/package.json index 28ef8ba392..abd095e4cf 100644 --- a/examples/webpack-build-server/package.json +++ b/examples/webpack-build-server/package.json @@ -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" } } diff --git a/examples/webpack-build-server/support/webpack.config.js b/examples/webpack-build-server/support/webpack.config.js index a9893a73d2..4e09c86624 100644 --- a/examples/webpack-build-server/support/webpack.config.js +++ b/examples/webpack-build-server/support/webpack.config.js @@ -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" - } - ] } };