當我運行webpack-dev-server
前三行控制檯輸出的是:使用webpack-dev-server時,我應該導航到localhost:8080還是localhost:8080/webpack-dev-server?
http://localhost:8080/webpack-dev-server/
webpack result is served from/
content is served from ./dist
我對我爲什麼要轉到localhost:8080/webpack-dev-server/
困惑。在過去,我會發現我的應用程序生活在localhost:8080
。有什麼不同?有沒有/webpack-dev-server
路徑組件有什麼優點和缺點?它會影響熱重裝嗎?
編輯:
熱重裝似乎是由/webpack-dev-server
影響的特徵。我的瀏覽器不使用重載以下配置:
var webpack = require('webpack');
const path = require('path')
module.exports = {
entry: "./src/index.js",
output: {
path: path.join(__dirname, 'dist'),
// publicPath: path.join(__dirname, 'dist'),
filename: "bundle.js"
},
devServer: {
contentBase: "./dist"
}
}
熱重裝似乎並沒有被添加了'--hot'選項甚至工作,如果我去'本地主機:8080' –