Package.json
"Scripts": { "init": "Webpack--progress--config webpack.dev.config.js", "Dev": " Webpack-dev-server--inline--hot--compress--history-api-fallback--config webpack.dev.config.js ", "Build": "Webpack--progress--hide-modules--config webpack.prod.config.js"},
server.js--similar Express build HTTP service
' Use strict 'varWebpack = require (' Webpack ')); var webpackdevserver = require (' webpack-dev-server '); varConfig = require ('./webpack.config ')); Config.entry.unshift (' webpack-dev-server/client?http://localhost:8090 ', ' webpack/hot/dev-server '); Config.plugins.push (NewWebpack. Hotmodulereplacementplugin ());//configuration here: Request Http://localhost:9090/api,//The equivalent is requested by the Local node service proxy to the Http://cnodejs.org/apivarProxy =[{target:"Https://cnodejs.org", Host:"Cnodejs.org", Path:"/api/*"}]//Start the service var app = new webpackdevserver (webpack (config), {publicPath:config.output.publicPath, Hot:true, Historyapifallback: true , Proxy:proxy}); App.listen (8090);
About Web-dev-server Records