Comments (4)
utils.getIP() 这个函数
只读取了en0 和 en1 的网卡
而我的网卡叫eth0, eth1.。。。。
可以加上这两个吗?
utils.getIp = position => {
const interfaces = os.networkInterfaces();
const ips = [];
if (interfaces.en0) {
for (let i = 0; i < interfaces.en0.length; i++) {
if (interfaces.en0[i].family === 'IPv4') {
ips.push(interfaces.en0[i].address);
}
}
}
if (interfaces.en1) {
for (let i = 0; i < interfaces.en1.length; i++) {
if (interfaces.en1[i].family === 'IPv4') {
ips.push(interfaces.en1[i].address);
}
}
}
if (position > 0 && position <= ips.length) {
return ips[position - 1];
} else if (ips.length) {
return ips[0];
}
return '127.0.0.1';
};
from easywebpack.
@MrTurnRight 可以的,你这边提个 PR 把 ,我这边出现不了这种场景,主要获取节点的方式不确定,需要你这边根据实际情况获取
from easywebpack.
utils.getIp = position => {
const interfaces = os.networkInterfaces();
const ips = [];
const netCards = [];
interfaces.en0 && netCards.push(interfaces.en0)
interfaces.en1 && netCards.push(interfaces.en1)
interfaces.eth0 && netCards.push(interfaces.eth0)
interfaces.eth1 && netCards.push(interfaces.eth1)
netCards.forEach(card => {
for (let i = 0; i < card.length; i++) {
if (card[i].family === 'IPv4') {
ips.push(card[i].address);
}
}
})
if (position > 0 && position <= ips.length) {
return ips[position - 1];
} else if (ips.length) {
return ips[0];
}
return '127.0.0.1';
};
我没有fork代码,,补上这几行就好了。。。
from easywebpack.
已发布新版本,重新安装依赖即可。
from easywebpack.
Related Issues (20)
- easy zip/tar --filename [filename] //filename 未生效 HOT 1
- egg + vue + ts 的项目,只要npm run debug 就会卡在一个webpack努力编译中的页面,求解!!!! HOT 12
- url-loader options 存在bug HOT 5
- 请教一下,easy zip 的执行流程在哪看? HOT 4
- 静态js文件修改没有热更新 HOT 3
- easywebpack cssModule 源码没找到在哪 HOT 2
- 修改publicpath 出现问题
- webpack的alias配置咨询 HOT 1
- 关于webpack.config.js的externals配置问题
- webpack pulicPath不支持相对路径 HOT 1
- webpack 无法热更新。 HOT 1
- utils.checkDllUpdate should handle publicPath changed
- use easywebpack cli to initialize a application which use [email protected] , start node server by npm run dev, all static resouces 404 HOT 1
- alias needed for "mini-css-extract-plugin".loader
- optimize.js | splitChunks rules: need handle node_modules in windows
- 如何通过webpack配置去掉view文件中存在的一堆css样式代码
- 使用webpack5需要将thread-loader依赖升级到最新 HOT 1
- 如何配置pwa?
- 该项目不维护了吗?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from easywebpack.