- 80
- 0
描述:npm run dev 开启项目 没有报错 显示无法访问此网站
代码:
package.json:
*"scripts": {
"dev": "webpack --watch --progress --config build/webpack.dev.conf.js",*
webpack.dev.conf.js:
const HOST = '127.0.0.1'
const PORT = '8080'
const devWebpackConfig = merge(baseWebpackConfig, {
module: {
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
},
// cheap-module-eval-source-map is faster for development
devtool: config.dev.devtool,
// these devServer options should be customized in /config/index.js
devServer: {
clientLogLevel: 'warning',
historyApiFallback: true,
hot: true,
compress: true,
host: HOST,
port: PORT,
open: config.dev.autoOpenBrowser,
overlay: config.dev.errorOverlay
? { warnings: false, errors: true }
: false,
publicPath: config.dev.assetsPublicPath,
proxy: config.dev.proxyTable,
quiet: true, // necessary for FriendlyErrorsPlugin
watchOptions: {
poll: config.dev.poll,
}
},
**命令行运行结果:**
I Your application is running here: http://127.0.0.1:8080
Hash: 18d4dc75a621c9da106b
Version: webpack 3.10.0
Time: 5526ms
Asset Size Chunks Chunk Names
0.js 318 kB 0 [emitted] [big]
static/img/hr-logo.0b6a588.svg 12 kB [emitted]
static/img/company-logo.12e0af2.jpg 76.4 kB [emitted]
static/img/hr-banner.aeedebc.jpg 62.2 kB [emitted]
static/img/m-company-logo.0566242.jpg 54.6 kB [emitted]
static/img/plus-banner-mobile.6a91180.svg 14.2 kB [emitted]
static/img/plus-banner.228bd34.jpg 82.2 kB [emitted]
static/img/zhichou-banner.886b8af.jpg 60.9 kB [emitted]
static/img/m-hr-logo.e5c7d89.svg 12.4 kB [emitted]
1.js 330 kB 1 [emitted] [big]
2.js 209 kB 2 [emitted]
app.js 426 kB 3 [emitted] [big] app
0.js.map 364 kB 0 [emitted]
1.js.map 381 kB 1 [emitted]
2.js.map 239 kB 2 [emitted]
app.js.map 525 kB 3 [emitted] app
index.html 976 bytes [emitted]
[./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/selector.js?type=script&index=0&bustCache!./src/views/HomePage.vue] ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0&bustCache!./src/views/HomePage.vue 547 bytes {2} [built]
[./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/selector.js?type=script&index=0&bustCache!./src/views/HrPage.vue] ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0&bustCache!./src/views/HrPage.vue 3.3 kB {0} [built]
[./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/selector.js?type=script&index=0&bustCache!./src/views/PlusPage.vue] ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0&bustCache!./src/views/PlusPage.vue 3.2 kB {1} [built]
[./node_modules/vue-loader/lib/template-compiler/index.js?{"id":"data-v-1a8461e6","hasScoped":false,"transformToRequire":{"video":["src","poster"],"source":"src","img":"src","image":"xlink:href"},"buble":{"transforms":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0&bustCache!./src/views/HrPage.vue] ./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-1a8461e6","hasScoped":false,"transformToRequire":{"video":["src","poster"],"source":"src","img":"src","image":"xlink:href"},"buble":{"transforms":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0&bustCache!./src/views/HrPage.vue 11.5 kB {0} [built]
[./node_modules/vue-loader/lib/template-compiler/index.js?{"id":"data-v-24f5bec6","hasScoped":false,"transformToRequire":{"video":["src","poster"],"source":"src","img":"src","image":"xlink:href"},"buble":{"transforms":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0&bustCache!./src/views/PlusPage.vue] ./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-24f5bec6","hasScoped":false,"transformToRequire":{"video":["src","poster"],"source":"src","img":"src","image":"xlink:href"},"buble":{"transforms":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0&bustCache!./src/views/PlusPage.vue 17.2 kB {1} [built]
[./node_modules/vue-loader/lib/template-compiler/index.js?{"id":"data-v-9ec71a3c","hasScoped":false,"transformToRequire":{"video":["src","poster"],"source":"src","img":"src","image":"xlink:href"},"buble":{"transforms":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0&bustCache!./src/views/HomePage.vue] ./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-9ec71a3c","hasScoped":false,"transformToRequire":{"video":["src","poster"],"source":"src","img":"src","image":"xlink:href"},"buble":{"transforms":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0&bustCache!./src/views/HomePage.vue 3.11 kB {2} [built]
[./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 509 bytes {3} [built]
结果
[./src/main.js] ./src/main.js 231 bytes {3} [built]
[./src/router/index.js] ./src/router/index.js 503 bytes {3} [built]
[./src/store/index.js] ./src/store/index.js 765 bytes {3} [built]
[./src/views/HomePage.vue] ./src/views/HomePage.vue 1.67 kB {2} [built]
[./src/views/HrPage.vue] ./src/views/HrPage.vue 1.66 kB {0} [built]
[./src/views/PlusPage.vue] ./src/views/PlusPage.vue 1.67 kB {1} [built]
[./src/views/img/m-company-logo.jpg] ./src/views/img/m-company-logo.jpg 83 bytes {0} [built]
[./src/views/img/plus-banner-mobile.svg] ./src/views/img/plus-banner-mobile.svg 87 bytes {1} [built]
+ 113 hidden modules
Child html-webpack-plugin for "index.html":
1 asset
[./node_modules/html-webpack-plugin/lib/loader.js!./index.html] ./node_modules/html-webpack-plugin/lib/loader.js!./index.html 1.32 kB {0} [built]
[./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 509 bytes {0} [built]
[./node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 517 bytes {0} [built]
+ 1 hidden module
结果http://localhost:8080/页面显示
无法访问此网站
localhost 拒绝了我们的连接请求。
0
打赏
收藏
点击回答
- 共 0 条
- 全部回答
-
回不到の从前 普通会员 1楼
webpack-dev-server 可能会拒绝连接请求,这可能是由于以下几个原因:
-
服务器资源未正确配置:请确保服务器的配置文件(webpack.config.js 或者服务器端的配置文件)中的资源路径正确,并且服务器能够正确地读取这些文件。
-
服务器未启动:请确保服务器已经启动并正在运行。可以通过
node server.js运行服务器,然后通过http://localhost:3000访问服务器来检查服务器状态。 -
配置错误:请检查服务器的配置文件,确保服务器已经正确地配置了 Webpack Dev Server,并且服务器可以正确地处理 HTTP 请求。
-
网络问题:如果请求是通过网络发送的,检查网络连接是否正常。
-
端口冲突:如果请求正在使用已有的端口,可能会导致 Webpack Dev Server 拒绝连接请求。请检查服务器的端口配置,并确保不会出现端口冲突的情况。
解决这些问题后,应该可以正常地运行 Webpack Dev Server。如果问题仍然存在,可能需要进一步的排查和调试。
-
更多回答
网站公告
- 扫一扫访问手机版
回答动态

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器更新之后。服务器里面有部分玩家要重新创建角色是怎么回事啊?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题函数计算不同地域的是不能用内网吧?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题ARMS可以创建多个应用嘛?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题在ARMS如何申请加入公测呀?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题前端小程序接入这个arms具体是如何接入监控的,这个init方法在哪里进行添加?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器刚到期,是不是就不能再导出存档了呢?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器的游戏版本不兼容 尝试更新怎么解决?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器服务器升级以后 就链接不上了,怎么办?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器转移以后服务器进不去了,怎么解决?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器修改参数后游戏进入不了,是什么情况?预计能赚取 0积分收益
- 回到顶部
- 回到顶部

