我是浏览器同步的新手,我似乎无法弄清楚如何让实时重新加载在代理服务器上工作。在我当前的设置中,我无权访问本地计算机上的文件,因此我必须使用代理。我目前有一个配置文件,这是当前设置。
module.exports = {
"ui": {
"port": 3001,
"weinre": {
"port": 8080
}
},
"files": ['Styles/bootstrap-custom-addons.css', '/Styles/*.css'],
"watchOptions": {},
"server": false,
"proxy": {
target: "http://example.com",
files: ['Styles/bootstrap-custom-addons.css', '/Styles/*.css'],
},
"port": 3000,
"middleware": false,
"ghostMode": {
"clicks": true,
"scroll": true,
"forms": {
"submit": true,
"inputs": true,
"toggles": true
}
},
"logLevel": "info",
"logPrefix": "BS",
"logConnections": false,
"logFileChanges": true,
"logSnippet": true,
"rewriteRules": false,
"open": "local",
"browser": "default",
"xip": false,
"hostnameSuffix": false,
"reloadOnRestart": true,
"notify": true,
"scrollProportionally": true,
"scrollThrottle": 0,
"reloadDelay": 0,
"reloadDebounce": 0,
"plugins": [],
"injectChanges": true,
"startPath": null,
"minify": true,
"host": null,
"codeSync": true,
"timestamps": true,
"clientEvents": [
"scroll",
"input:text",
"input:toggles",
"form:submit",
"form:reset",
"click"
],
"socket": {
"path": "/browser-sync/socket.io",
"clientPath": "/browser-sync",
"namespace": "/browser-sync",
"clients": {
"heartbeatTimeout": 5000
}
},
"tagNames": {
"less": "link",
"scss": "link",
"css": "link",
"jpg": "img",
"jpeg": "img",
"png": "img",
"svg": "img",
"gif": "img",
"js": "script"
}
};
页面滚动和点击可以跨浏览器工作,但是当我更新服务器上的文件时,它不会自动重新加载页面,是我没有正确设置配置文件吗?另外,运行 browser-sync start --config bs-config.js 和只运行 brower-sync start --proxy “ http://www.example.com ”有什么区别?