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

watch or auto build option #7

Closed
IwanKaramazow opened this issue Jun 13, 2016 · 4 comments
Closed

watch or auto build option #7

IwanKaramazow opened this issue Jun 13, 2016 · 4 comments

Comments

@IwanKaramazow
Copy link

Should there be something like an auto build option at the level of Jengaboot, or is it up to the user to write a script for this? I'm currently using a simple node script that watches the src folder and rebuilds on change.

@chenglou
Copy link
Collaborator

Jenga has a watcher, but it's currently linux-only. I guess you could set up your own watcher for now?

@IwanKaramazow
Copy link
Author

I've set up my own watcher for now, I'll close this issue.

@jordwalke
Copy link
Collaborator

@IwanKaramazow - What worked well for you?

@IwanKaramazow
Copy link
Author

@jordwalke : node watch + webpack for hmr & js modules in the browser

// watch.js
const { exec } = require('child_process');
const sane = require('sane'); //wrapper around fs.watch

const src = `${__dirname}/src`;
const compile_command = 'node ./node_modules/.bin/run';

const watcher = sane(src);

watcher.on('change', (filepath, root, stat) => {
    exec(compile_command, (err, stdout, stderr) => {
      if (err) {
        console.error(err);
        return;
      }
      console.log(stdout);
    });
 });

It does the job...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants