ocombe / browser-sync-brunch Goto Github PK
View Code? Open in Web Editor NEWAdds BrowserSync http://browsersync.io/ support to brunch for automatic browser reloading and much more !
License: MIT License
Adds BrowserSync http://browsersync.io/ support to brunch for automatic browser reloading and much more !
License: MIT License
Latest version on npm is 0.0.9 https://www.npmjs.com/package/browser-sync-brunch
But looking on GitHub, latest release is 0.0.10.
I can't work out if this is actually normal behaviour.
I am using a slightly unusual setup but nothing complicated. Basically, I have Brunch, a few plugins (including browser-sync!), and I'm using vibe.d as a server (that's the unusual bit). Browsersync is set up in proxy mode and seems happy. When I open the browser window, I get a 'browser-sync connected' message and all watched files update immediately in the browser.
But I am getting requests hitting the server for the file ;
localhost:3000/browser-sync/browser-sync-client.2.18.13.js
And this file doesn't exist, resulting in a 404 (reported in the browser console and in the server log).
The request for this file is coming from the script 'browser-sync-injector.js', according to my browser console.
I notice that browsersync in the browser also requests the file ;
localhost:3000/browser-sync/browser-sync-client.js?v=2.18.13
But this request doesn't even reach my server - I presume it is intercepted and dealt with by the browsersync proxy? In fact, this file is served to the browser even if I shutdown the vibe.d server so the only place it can be coming from is the proxy server.
Are those two files that are being requested two alternative ways of requesting the same file, one of which will work, and the other is supposed to fail?
The only browser-sync feature that doesn't seem to be working here is synced scrolling across connected browsers (which doesn't really bother me much). I have no idea if this is linked to the above missing file.
So, is this normal or should I fix it?
Hi ! I have a issue with the scriptPath option. It seems to be not apply.
plugins:
browserSync:
port: 81
scriptPath: "localhost:1281/browser-sync/browser-sync-client.2.1.6.js"
but when i reach localhost:80 it tries to get the browser-sync-client from localhost:81 which is ok according to port option but i need to retrieve the script from a other port because i'm on a virtual server address form the internet with port prefix '12' so when i want to reach port 81 form the internet i need to address the port 1281. I hope this is clear if it's not feel free to ask.
Thanks.
Browsersync only seems to work when I run brunch watch -s
the weird thing is it actually attempts to use port 3334 but actually works on port 3333. If try to go to port 3334 I see Cannot GET /
.
When I run brunch watch
without the server flag when I go to port 3333 I also see Cannot GET /
I've included my brunch-config and the debug log. Let me know if you need more info.
module.exports = {
config: {
paths: {
watched: ["app"]
},
files: {
javascripts: {
joinTo: {
'js/vendor.js': /^(?!app)/,
'js/app.js': /^app/
}
},
stylesheets: {
joinTo: "css/app.css"
}
},
plugins: {
elmBrunch: {
mainModules: ["app/elm/Main.elm"],
outputFolder: "public/js/",
parameters: ['--warn']
},
sass: {
mode: "native",
options: {
includePaths: [
'node_modules/bulma'
]
}
},
babel: {
presets: ['es2015'],
ignore: [
// /^node_modules/,
/^elm/
]
},
browserSync: {
port: 3333,
logLevel: "debug",
// open: "local",
notify: false
},
}
}
};
When using this plugin brunch w
will exit when the config.coffee
gets changed. Without this plugin it would just reload.
Might want to change the --save
npm install option to --save-dev
, thanks for this contribution!
Any chance of increasing the browsersync dependency version up to >2.6.0, to allow use of watch event callbacks, as documented here : https://browsersync.io/docs/options/#option-files
I've done this locally and it is working without issue (so far).
Current dep version of browser-sync does not work well with reloading assets in HTML5 mode. Please update the version dep, to save shrinkwrapping.
When the brunch workers are enabled, it doesn't work because multiple instances of BrowserSync are launched on different ports and the changes are not pushed to the correct websocket.
With the default config, I can access the BrowserSync UI via localhost:3001 && ipaddress:3001 on my mobile device. I cannot load the default port :3333 on my mobile device. Any suggestions?
When you edit files that can be injected (css for example) and other files at the same time (js, html), the browser is not always reloaded (only the css is injected)
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.