Coder Social home page Coder Social logo

--watch behaves strangely about deno HOT 2 CLOSED

bkerin avatar bkerin commented on June 27, 2024
--watch behaves strangely

from deno.

Comments (2)

lucacasonato avatar lucacasonato commented on June 27, 2024

When specifying --watch, the script program will restart if any of the files in the module graph (so the entrypoint, or any file imports from it or any of it's dependencies) change.

You can pass additional files or folder to --watch as paths relative to your cwd. When passing multiple paths, separate them with ,. This is also explained in the help text.

      --watch[=<FILES>...]
          Watch for file changes and restart process automatically.
          Local files from entry point module graph are watched by default.
          Additional paths might be watched by passing them as arguments to this flag.

Finally, you can exclude files from being watched, by specifying a --watch-exclude flag:

      --watch-exclude[=<FILES>...]
          Exclude provided files/patterns from watch mode

The behaviour where non existant paths are not an error is expected and desired - we want to allow you to watch a directory or folder that does not exist yet, that may only be created by the script itself during execution.

from deno.

bkerin avatar bkerin commented on June 27, 2024

You're right the default is specified. I'd phrase it differently though since it's a little unusual to have an option with an argument also have a global effect. The use of commas isn't documented as far as I can tell though, and neither is the pattern format referred to. Maybe it could be rewritten like this:

 --watch={=<FILE_PATTERNS>...]
    Watch for file changes and restart process automatically.
    When this option appears local files from entry point module graph are watched by default.  If an argument is provided to this
    option it give a comma-separated list of ???-style file patterns that will also be watched.

I still don't know what file patterns are supported. It doesn't seem be be shell-style globs (e.g. *.perl).

from deno.

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.