webpack-dev-server Nodejs API中运行inline模式 失败:
打开http://localhost:8091/, 显示404
文件结构如下:
-build
--app.js
--app.css
-index.html
webpack.config.js 如下:
entry: {
app: [
'./src/Main'
]
},
output: {
publicPath : '/assets/',
path : __dirname + '/build',
filename: 'app.js'
},
server.js 如下:
var config = require("./webpack.config.js");
var webpack = require('webpack');
var WebpackDevServer = require('webpack-dev-server');
config.entry.app.unshift("webpack-dev-server/client?http://localhost:8091/");
var compiler = webpack(config);
var server = new WebpackDevServer(compiler, {
contentBase:'build/',
publicPath: config.output.publicPath
});
server.listen(8091);
命令行代码如下:
"dev-hot":"node server-devServer-hot.js"
现在发现