I'm using browser sync that I installed with NPM to watch my projects as I work on them. Is there a way to get it to watch the root folder and the css folder at once?
Browser synchronization (often simply called sync) is a free cloud service provided by a web browser vendor for sharing settings and data across multiple installs. This is typically used to maintain a consistent browser setup on multiple devices. The user must be logged-in to their account to sync a browser.
In Sublime Text 3 go to Preferences -> Browse Packages... Open 'Browser Sync' folder and edit the browser property in browser_sync_launch. js file. Save this answer.
A bit late, but still, since I needed it I'll post it here for future reference :
Either start browser-sync init
and add something like this to the bs-config.js
file :
files: ["app/css/style.css", "app/js/*.js"]
or start browser-sync with following option :
browser-sync start --server --files="**/*"
This will load current directory AND every other subdirectory.
source : https://www.browsersync.io/docs/options/
To watch multiple files, list the different directories after the --files
options, e.g. --files 'directory1' 'directory2/sub'
.
An entire npm script command can look like this: browser-sync start --proxy 'localhost:3000' --files 'public' 'src' 'views'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With