reference
https://discuss.colyseus.io/topic/424/fixing-warnings-when-bundling-colyseus-server-with-webpack
files
readme.md
package.json
tsconfig.json
webpack.config.js
webpack.bat
(for Windows)main.ts
instructions
npm install
npm run build
output
> demo@1.0.0 build C:\demo
> webpack --config webpack.config.js
Hash: 5a6cc71b15fda019b94a
Version: webpack 4.44.2
Time: 5110ms
Built at: 2020-12-07 20:54:53
Asset Size Chunks Chunk Names
main-built.js 1000 KiB 0 [emitted] main
main-built.js.map 1.1 MiB 0 [emitted] [dev] main
Entrypoint main = main-built.js main-built.js.map
[0] ./main.ts 282 bytes {0} [built] [1 error]
[7] external "http" 42 bytes {0} [built]
[8] external "net" 42 bytes {0} [built]
[11] external "events" 42 bytes {0} [built]
[12] external "https" 42 bytes {0} [built]
[13] external "tls" 42 bytes {0} [built]
[14] external "crypto" 42 bytes {0} [built]
[15] external "url" 42 bytes {0} [built]
[17] external "zlib" 42 bytes {0} [built]
[22] external "stream" 42 bytes {0} [built]
[35] external "tty" 42 bytes {0} [built]
[36] external "util" 42 bytes {0} [built]
[38] external "os" 42 bytes {0} [built]
[122] external "assert" 42 bytes {0} [built]
[139] external "querystring" 42 bytes {0} [built]
+ 150 hidden modules
WARNING in ./node_modules/ws/lib/buffer-util.js
Module not found: Error: Can't resolve 'bufferutil' in 'C:\demo\node_modules\ws\lib'
@ ./node_modules/ws/lib/buffer-util.js
@ ./node_modules/ws/lib/websocket.js
@ ./node_modules/ws/index.js
@ ./node_modules/colyseus/lib/Server.js
@ ./node_modules/colyseus/lib/index.js
@ ./main.ts
WARNING in ./node_modules/ws/lib/validation.js
Module not found: Error: Can't resolve 'utf-8-validate' in 'C:\demo\node_modules\ws\lib'
@ ./node_modules/ws/lib/validation.js
@ ./node_modules/ws/lib/receiver.js
@ ./node_modules/ws/index.js
@ ./node_modules/colyseus/lib/Server.js
@ ./node_modules/colyseus/lib/index.js
@ ./main.ts
WARNING in ./node_modules/default-gateway/README.md 1:0
Module parse failed: Unexpected character '#' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> # default-gateway
| [![](https://img.shields.io/npm/v/default-gateway.svg?style=flat)](https://www.npmjs.org/package/default-gateway) [![](https://img.shields.io/npm/dm/default-gateway.svg)](https://www.npmjs.org/package/default-gateway) [![](https://api.travis-ci.org/silverwind/default-gateway.svg?style=flat)](https://travis-ci.org/silverwind/default-gateway)
|
@ ./node_modules/default-gateway sync ^\.\/.*$ ./README.md
@ ./node_modules/default-gateway/index.js
@ ./node_modules/internal-ip/index.js
@ ./node_modules/colyseus/lib/discovery/index.js
@ ./node_modules/colyseus/lib/Server.js
@ ./node_modules/colyseus/lib/index.js
@ ./main.ts
WARNING in ./node_modules/default-gateway/LICENSE 1:14
Module parse failed: Unexpected token (1:14)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> Copyright (c) silverwind
| All rights reserved.
|
@ ./node_modules/default-gateway sync ^\.\/.*$ ./LICENSE
@ ./node_modules/default-gateway/index.js
@ ./node_modules/internal-ip/index.js
@ ./node_modules/colyseus/lib/discovery/index.js
@ ./node_modules/colyseus/lib/Server.js
@ ./node_modules/colyseus/lib/index.js
@ ./main.ts
ERROR in ./node_modules/redis-parser/lib/hiredis.js
Module not found: Error: Can't resolve 'hiredis' in 'C:\demo\node_modules\redis-parser\lib'
@ ./node_modules/redis-parser/lib/hiredis.js 3:14-32
@ ./node_modules/redis-parser/lib/parser.js
@ ./node_modules/redis-parser/index.js
@ ./node_modules/redis/index.js
@ ./node_modules/colyseus/lib/presence/RedisPresence.js
@ ./node_modules/colyseus/lib/index.js
@ ./main.ts