webpack-dev-pack(linux)

本文介绍了解决Webpack-dev-server在Linux环境下无法通过特定IP访问的问题,通过配置--host参数实现任意IP访问。

为了期末考试复习了很久,把我的事业放下了一段时间,然而发现复习那么久,没有一点卵用。。。拾起我的事业,嘿咻

刚在做一个React小项目的时候,用webpack-dev-server来自动刷新页面,在linux上跑代码,但是在浏览器上访问http://111.230.240.181:8080/webpack-dev-server/index.html显示无法访问
查阅了很多资料,基本上是关于webpack-dev-server的两种模式以及热模块替换方面的知识,最终找到原因:在终端加上这句代码

 webpack-dev-server --host

host后面不加任何ip表示接受任意ip访问,否则只能为localhost

D:\admin-project\guangxi-quan-vue3>npm run electron:build -- --debug > flowoutdemo@0.0.0 electron:build > set ELECTRON_MIRROR=https://github.com/electron/electron/releases/download/ && npm run build && electron-builder -c.extraMetadata.main=electron/main.js --debug > flowoutdemo@0.0.0 build > vite build vite v5.4.19 building for production... ✓ 136 modules transformed. dist/index.html 0.43 kB │ gzip: 0.29 kB dist/assets/index-fRN9Gjbe.css 3.24 kB │ gzip: 1.18 kB dist/assets/home-4Rnli7SO.css 7.87 kB │ gzip: 1.90 kB dist/assets/index-DWI3OzZM.js 92.14 kB │ gzip: 36.63 kB dist/assets/home-qQcH4Glo.js 199.11 kB │ gzip: 69.78 kB ✓ built in 1.28s cli.js build Build Commands: cli.js build Build [default] cli.js install-app-deps Install app deps cli.js node-gyp-rebuild Rebuild own native code cli.js create-self-signed-cert Create self-signed code signing cert for Windows apps cli.js start Run application in a development mode using electron-webpack Building: -m, -o, --mac, --macos Build for macOS, accepts target list (see https://goo.gl/5uHuzj). [array] -l, --linux Build for Linux, accepts target list (see https://goo.gl/4vwQad) [array] -w, --win, --windows Build for Windows, accepts target list (see https://goo.gl/jYsTEJ) [array] --x64 Build for x64 [boolean] --ia32 Build for ia32 [boolean] --armv7l Build for armv7l [boolean] --arm64 Build for arm64 [boolean] --universal Build for universal [boolean] --dir Build unpacked dir. Useful to test. [boolean] --prepackaged, --pd The path to prepackaged app (to pack in a distributable format) --projectDir, --project The path to project directory. Defaults to current working directory. -c, --config The path to an electron-builder config. Defaults to `electron-builder.yml` (or `json`, or `json5`, or `js`, or `ts`), see https://goo.gl/YFRJOM Publishing: -p, --publish Publish artifacts, see https://goo.gl/tSFycD [choices: "onTag", "onTagOrDraft", "always", "never", undefined] Other: --help Show help [boolean] --version Show version number [boolean] Examples: electron-builder -mwl build for macOS, Windows and Linux electron-builder --linux deb tar.xz build deb and tar.xz for Linux electron-builder --win --ia32 build for Windows ia32 electron-builder set package.json property `foo` to -c.extraMetadata.foo=bar `bar` electron-builder configure unicode options for NSIS --config.nsis.unicode=false See https://electron.build for more documentation. Unknown argument: debug
最新发布
06-07
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值