Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a Watcher generator #36

Closed
palazzem opened this issue Aug 6, 2016 · 0 comments
Closed

add a Watcher generator #36

palazzem opened this issue Aug 6, 2016 · 0 comments
Assignees
Milestone

Comments

@palazzem
Copy link
Collaborator

palazzem commented Aug 6, 2016

Wheelie could offer a public API to generate a watcher for a Task. Suppose we have a task that should be triggered everytime a file changes in a folder, it's something that only the Task itself could know.

I propose to have a config attribute that if is found during the Wheelie build, a new watcher is activated. For instance, a SASS task could:

function config(globals) {
  var source = globals.src + 'scss/**/*.{sass,scss}';

  return {
    watcher: source,
    src: source,
    dest: globals.dest + 'css/',
    sourceComments: 'map',
    imagePath: 'images/',
    autoprefixer: ['last 2 version']
  };
}

At this point the Wheelie#add() method should add the task to the watchers list in the _registry, and a real watcher task must be generated using this list.
If we achieve this architecture, we can also set the task watch as a reasonable default for Wheelie.

@palazzem palazzem added this to the 0.3.0 milestone Aug 6, 2016
@palazzem palazzem self-assigned this Aug 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant