dora-js / dora-plugin-livereload Goto Github PK
View Code? Open in Web Editor NEWdora plugin for livereload
dora plugin for livereload
工作需要,有时候需要同时调试多个站点,希望可以增加自定义端口的功能。
dora-plugin-livereload/src/index.js
Line 141 in c13503f
console信息
proxy: load rule from proxy.config.js
(node:27570) DeprecationWarning: 'GLOBAL' is deprecated, use 'global'
proxy: listened on 8989
livereload: listening on 35729
proxy: GET / matches /*, forward to http://localhost:8000/output
err with request :Error: connect ECONNREFUSED 127.0.0.1:8000 /
package.json
"start": dora --plugins 'proxy,livereload'
proxy.config.js
'use strict';
var mock = {
'/*': 'http://localhost:8000/output', // 全部代理到output目录
};
require('fs').readdirSync(require('path').join(__dirname + '/mock'))
.forEach(function (file) {
Object.assign(mock, require('./mock/' + file));
});
module.exports = mock;
devDependencies
"dora": "^0.4.3",
"dora-plugin-livereload": "^0.5.2",
"dora-plugin-proxy": "^0.8.0",
node 6
第一次使用,哪里配置错误?
> os.networkInterfaces()
{ lo0:
[ { address: '::1',
netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff',
family: 'IPv6',
mac: '00:00:00:00:00:00',
scopeid: 0,
internal: true },
{ address: '127.0.0.1',
netmask: '255.0.0.0',
family: 'IPv4',
mac: '00:00:00:00:00:00',
internal: true },
{ address: 'fe80::1',
netmask: 'ffff:ffff:ffff:ffff::',
family: 'IPv6',
mac: '00:00:00:00:00:00',
scopeid: 1,
internal: true } ],
en0:
[ { address: 'fe80::3e15:c2ff:fedf:58ea',
netmask: 'ffff:ffff:ffff:ffff::',
family: 'IPv6',
mac: '3c:15:c2:df:58:ea',
scopeid: 4,
internal: false },
{ address: '192.168.199.134',
netmask: '255.255.255.0',
family: 'IPv4',
mac: '3c:15:c2:df:58:ea',
internal: false } ],
awdl0:
[ { address: 'fe80::b85a:4dff:fe78:452',
netmask: 'ffff:ffff:ffff:ffff::',
family: 'IPv6',
mac: 'ba:5a:4d:78:04:52',
scopeid: 8,
internal: false } ],
utun0:
[ { address: '30.39.56.182',
netmask: '255.255.255.255',
family: 'IPv4',
mac: '00:00:00:00:00:00',
internal: false } ] }
internalIp.v4() => 30.39.56.182
ws://30.39.56.182:35729/livereload 并不能访问到.
这个能解决下吗 ?
希望可以路径配置成 <script src='./livereload.js'></script>
这样方便分享本地服务地址给其他人看。
compiler, injectHost, enableJs 这些参数具体怎么用,有什么含义?请完善readme文档
10.x:8001/ html 内产生代码
<script src='http://192.x:35729/livereload.js'></script>
不能用 192 的 ip
由于部分业务中并不会存在实体的 html 文件
之后做成创建 script 节点的方式来满足需求
便于 doc 接入
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.