![]() Option event to only trigger watch on certain events. Will reload a Gruntfile before running tasks if Gruntfile is modified. v0.4.0 Option livereload to start live reload servers.Watchers now close more properly on task run. Reverted "run again" with interrupt off to fix infinite recursion issue. Tasks now optional with livereload option. v0.4.3 Only group changed files per target to send correct files to live reload.Ensure tasks are an array to not conflict with cliArgs. Not needed and causes problems for Windows. v0.4.4 Remove gracefully closing SIGINT.Add dateFormat option to override the date/time output upon completion. Re-grab task/target options upon each task run. Moved libs/vars into top scope to prevent re-init. Changed nospawn option to spawn ( nospawn still available for backwards compatibility). Added atBegin option to run tasks when watcher starts. v0.5.0 Added target name to watch event.v0.5.1 Fixed issue with options resetting.v0.5.2 Fixed issue running tasks after gruntfile is reloaded.v0.5.3 Fixed for live reload missing files.Add livereloadOnError, which if set to false will not trigger live reload if there is an error. Update to Use a fork of tiny-lr (which has quiter operation, support for HTTPS and Windows path fixes). Add reload option to specify files other than Gruntfile files to reload. Fix to make interrupt work more than once. cwd option now accepts separate settings for files and spawn. v0.6.0 Clear changed files after triggering live reload to ensure they're only triggered once.v0.6.1 Fix for watch targets named "default".Support cwd.event to emit events relative to path. Fix endless loop issue with atBegin/ nospawn. v1.1.0 Update to v1.0.1 Update to v1.0.0 Updated tiny-lr, gaze, async and lodash dependencies.The main server must include a script tag or a browser extension to the livereload server in order for the browser automatically. When the 'livereload' option is enabled for 'watch' tasks, it will handle triggering the live reload server for each tasks and when files are modified, which then server back to main server ex: 3000. You'll have the connect web server on separate port ex: port 9000 from your main server. Instead of restarting your server each time a static file is changed, start a static web server using (grunt-contrib-connect). How can I have the browser reload for files listed in a task? Just be aware that with this option enabled, the watch task is more prone to failure. If you would like a faster watch task or need to share the context please set the spawn option to false. It also cripples tasks that rely on the watch task to share the context with each subsequent run (i.e., reload tasks). Spawning does cause a performance hit (usually 500ms for most environments). As well as more efficiently with more complex tasks and file structures. ![]() Sandboxing task runs also allows this watch task to run more stable over long periods of time. In an effort to keep the experience consistent and continually produce expected results, this watch task spawns tasks as child processes by default. ![]() Each time a user runs grunt a process is spawned and tasks are ran in succession. The goal of this watch task is as files are changed, run tasks as if they were triggered by the user himself or herself. Why spawn as child processes as a default? Please see issues #35 and #145 for more information. If you would like to trigger the live reload server yourself, simply POST files to the URL: Or if you rather roll your own live reload implementation use the following example: It is encouraged to read the documentation for tiny-lr. Live reloading is made easy by the library tiny-lr. Try the connect-livereload middleware for injecting the live reload script into your page. One method is to use Connect middleware to inject the script tag into your page. Since live reloading is used when developing, you may want to disable building for production (and are not using the browser extension). Once installed please use the default live reload port 35729 and the browser extension will automatically reload your page without needing the tag. Please visit how do I install and use the browser extensions for help installing an extension for your browser. Instead of adding a script tag to your page, you can live reload your page by installing a browser extension. Using Live Reload with the Browser Extension Feel free to add this script to your template situation and toggle with some sort of dev flag. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |