Comments (8)
Change the server.baseDir option to this & try again - you shouldn't need the snippets if you're using the server.
server: {
baseDir: "./"
}
from browser-sync.
Watch all HTML files in a single directory
files: "*.html"
Watch all HTML files, including those in sub directories
files: "**/*.html"
from browser-sync.
Got it.
But there seems to be something you need to do with the following scripts:
<script src='http://10.2.2.179:3000/socket.io/socket.io.js'></script>
<script src='http://10.2.2.179:3001/browser-sync-client.min.js'></script>
When I do this on the console: browser-sync --files *
I can then watch the HTML files but ONLY if those files have those two scripts in them at the moment I execute the above command.
I can remove them afterwards, yes, but if I need to watch another HTML file it has to have those two scripts before the command is ran, otherwise browser sync won't live refresh the HTML files.
Now, the only way I know I can watch HTML files is by running browser-sync --files *
in the command line and not via a config file, at least it doesn't work for me because as soon as I run browser-sync --config config.js
it then creates a server and looks for an index.html file and that's it, there's no way to watch other HTML files at all.
Here's the config.js I have (is based on the tutorial here):
module.exports = {
//files: "css/*, *.html",
files: "*",
//host: "192.168.1.1",
ghostMode: {
links: true,
forms: true,
scroll: true
},
server: {
baseDir: ""
}
};
Thanks again.
from browser-sync.
Well, yes sir, that fixed it :D
A million Thanks for the help and for this awesome app.
from browser-sync.
Any time!
We're building a website for browser-sync soon & it will have much clearer documentation/examples
from browser-sync.
That's awesome to hear, looking forward to the new website.
And if you guys need any feedback with a bunch of n00b questions for beginners, look no further, I'd be glad to help.
from browser-sync.
### My project is hosted in a folder called flexbox-css.git and inside contains concepts.html, main.css and although I already use this instruction browser-sync start --server --files "*.html" I still get this message Cannot GET / How do I solve it?
from browser-sync.
use : browser-sync start --server --directory --files "*" to load all.
from browser-sync.
Related Issues (20)
- Browser Sync does not load - white screen with Webpack / Wordpress HOT 3
- Proxy mangles URL strings in JSON
- use chalk everywhere
- browser-sync tried to access chalk, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound HOT 7
- Failing to update HOT 1
- Error [ERR_REQUIRE_ESM]: require() of ES Module [...]/node_modules/.pnpm/[email protected]/node_modules/chalk/source/index.js from [...]/node_modules/.pnpm/[email protected]/node_modules/browser-sync/dist/async.js not supported. HOT 3
- Release notes for 2.29.1? HOT 6
- [BUG] Breaking change in 2.29 (removed document.write) HOT 2
- Not working on node@^20.0.0 HOT 3
- Not working on OSX with Chrome HOT 3
- cant read any cookies using JS with BS Proxy
- Browsersync has some vulnerabilities due to localtunnel and axios dependency HOT 13
- BrowserSync reloads the page displaying `index.html` even though I trigger a reload for the file `other.html`
- How do we stop it from reloading when the window is unfocused (blur)
- bug(ansi): X11 color names in console
- bug/question(glob): Browsersync reloads browser tabs when I save files that isnβt matches by glob patterns HOT 1
- Content Security Policy errors with (Latest) Chrome browser cause Cannot Get error HOT 2
- Browsersync causes memory overflow
- When using import to import browser-sync, it can run without using create. Does this mean that create is not needed?
- Browser Sync not Updating PHP outside BODY + Certificate Issues
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 browser-sync.