webpack 用什么语言开发
1 回答
慕标5832272
TA贡献1966条经验 获得超4个赞
新建一个server服务用他来启动监听webpack.config.js
用node server.js启动服务
var webpack = require('webpack');
var webpackDevMiddleware = require("webpack-dev-middleware");
var webpackDevServer = require('webpack-dev-server');
var config = require("./webpack.config.js");
config.entry.index.unshift('webpack/hot/dev-server');
config.entry.index.unshift('webpack-dev-server/client?');
var compiler = webpack(config);
var server = new webpackDevServer(compiler, {
historyApiFallback: true,
hot: true,
inline: true,
stats: 'errors-only',
host: "localhost",
port: "8080",
});
server.listen(8080);
- 1 回答
- 0 关注
- 1830 浏览
添加回答
举报
0/150
提交
取消