Giter VIP home page Giter VIP logo

Comments (8)

shakyShane avatar shakyShane commented on June 18, 2024 1

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.

shakyShane avatar shakyShane commented on June 18, 2024

Watch all HTML files in a single directory

files: "*.html"

Watch all HTML files, including those in sub directories

files: "**/*.html"

from browser-sync.

ricardozea avatar ricardozea commented on June 18, 2024

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.

ricardozea avatar ricardozea commented on June 18, 2024

Well, yes sir, that fixed it :D

A million Thanks for the help and for this awesome app.

from browser-sync.

shakyShane avatar shakyShane commented on June 18, 2024

Any time!

We're building a website for browser-sync soon & it will have much clearer documentation/examples

from browser-sync.

ricardozea avatar ricardozea commented on June 18, 2024

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.

fantomas-code avatar fantomas-code commented on June 18, 2024

### 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.

AswanthGit avatar AswanthGit commented on June 18, 2024

use : browser-sync start --server --directory --files "*" to load all.

from browser-sync.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.