javascript - Get Webpack-Dev-Server Running in Webpack2 -


i cannot seem webpack-dev-server webpack2 work.

i using versions: webpack@2.1.0-beta.25 & webpack-dev-server@2.1.0-beta.10

im getting following cli log:

 http://localhost:8080/ webpack result served / content served /var/www/homelyfe/hl-app/app/index.js hash: 2830dae8362c968c034c version: webpack 2.1.0-beta.25 time: 544ms        asset       size  chunks             chunk names run.build.js    47.6 kb       0  [emitted]  app   index.html  198 bytes          [emitted]   chunk    {0} run.build.js (app) 43.4 kb [entry] [rendered]     [0] ./app/index.js 69 bytes {0} [built]     [1] (webpack)-dev-server/client?http://localhost:8080 4.14 kb {0} [built]     [2] ./~/punycode/punycode.js 14.7 kb {0} [built]     [3] ./~/querystring-es3/index.js 127 bytes {0} [built]     [4] ./~/url/url.js 23.3 kb {0} [built]     [5] (webpack)/buildin/global.js 506 bytes {0} [built]     [6] (webpack)/buildin/module.js 548 bytes {0} [built]     [7] multi app 40 bytes {0} [built]  error in (webpack)-dev-server/client?http://localhost:8080 module not found: error: can't resolve './socket' in '/var/www/homelyfe/hl-app/node_modules/webpack-dev-server/client'  @ (webpack)-dev-server/client?http://localhost:8080 4:13-32  @ multi app  error in (webpack)-dev-server/client?http://localhost:8080 module not found: error: can't resolve 'strip-ansi' in '/var/www/homelyfe/hl-app/node_modules/webpack-dev-server/client'  @ (webpack)-dev-server/client?http://localhost:8080 3:16-37  @ multi app  error in (webpack)-dev-server/client?http://localhost:8080 module not found: error: can't resolve 'webpack/hot/emitter' in '/var/www/homelyfe/hl-app/node_modules/webpack-dev-server/client'  @ (webpack)-dev-server/client?http://localhost:8080 124:19-49  @ multi app  error in ./~/url/url.js module not found: error: can't resolve './util' in '/var/www/homelyfe/hl-app/node_modules/url'  @ ./~/url/url.js 25:11-28  @ (webpack)-dev-server/client?http://localhost:8080  @ multi app  error in ./~/querystring-es3/index.js module not found: error: can't resolve './decode' in '/var/www/homelyfe/hl-app/node_modules/querystring-es3'  @ ./~/querystring-es3/index.js 3:33-52  @ ./~/url/url.js  @ (webpack)-dev-server/client?http://localhost:8080  @ multi app  error in ./~/querystring-es3/index.js module not found: error: can't resolve './encode' in '/var/www/homelyfe/hl-app/node_modules/querystring-es3'  @ ./~/querystring-es3/index.js 4:37-56  @ ./~/url/url.js  @ (webpack)-dev-server/client?http://localhost:8080  @ multi app child html-webpack-plugin "index.html":     chunk    {0} index.html 539 kb [entry] [rendered]         [0] ./~/lodash/lodash.js 537 kb {0} [built]         [1] (webpack)/buildin/global.js 506 bytes {0} [built]         [2] (webpack)/buildin/module.js 548 bytes {0} [built]         [3] ./~/html-webpack-plugin/lib/loader.js!./~/html-webpack-plugin/default_index.ejs 540 bytes {0} [built] webpack: bundle valid. 

my webpack.config.js file looks this:

const path = require( "path" ); const merge = require( "merge" ); const htmlwebpackplugin = require( "html-webpack-plugin" ); const parts = require( "./webpack.config.parts" ); const paths = {     app : path.join( __dirname, "app" ),     build : path.join( __dirname, "build" ) };  const common = {     entry : {         app : paths.app + "/index.js"     },     output : {         filename : "run.build.js",         path : paths.build     },     resolve : {         alias : {             components : path.resolve( __dirname, "app/components" )         },         extensions : [ "js", "jsx" ]     },     devserver : {         contentbase : paths.app     },     module : {         rules : [             {                 test : "/\.jsx?$/",                 use : [                     {                         loader : "babel-loader",                         options : {                             presets : [                                 "react",                                 "es2015"                             ]                         }                     }                 ]             }         ]     },     plugins : [         new htmlwebpackplugin({             title : "!!! testing webpack2 !!!"         })     ] };  var config;     switch( process.env.npm_lifecycle_event ){     case( "buildprod" ):         config = merge( common,                              {} );     case( "startdev" ):     default:         config = merge( common,                              {                                  devserver : {                                      contentbase : paths.app                                  }                              }); } module.exports = config; 

what missing?

the solution pass --no-inline option script in package.json. so, within package.json, scripts obj be:

"scripts" : {     "startdev" : "webpack-dev-server --no-inline" } 

https://webpack.js.org/configuration/dev-server/#devserver-inline-cli-only


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -