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-bluekit exits immediately #85

Closed
OscarBarrett opened this issue Nov 23, 2016 · 1 comment
Closed

watch-bluekit exits immediately #85

OscarBarrett opened this issue Nov 23, 2016 · 1 comment

Comments

@OscarBarrett
Copy link
Contributor

I'm using gulp version 3.9.1.

Task:

gulp.task('default', ['build-bluekit', 'watch-bluekit']);

BlueKit config:

let componentDirs = fs.readdirSync('components').filter(function(file) {
  return fs.statSync(path.join('components', file)).isDirectory();
});

const pathsArray = componentDirs.map((dir) => `./${dir}`);
const baseDir = `${__dirname}/components`;

createBlueKit({
  baseDir: baseDir,
  paths: pathsArray,
  noSpecialReplacements: true
});

Output:

$ gulp                                                                                                                                                                                                         
[11:15:23] Requiring external module babel-register
[11:15:24] Using gulpfile gulpfile.babel.js
[11:15:24] Starting 'build-bluekit'...
Rebuilding BlueKit
BlueKit generated components index to file: components/componentsIndex.js
[11:15:25] Finished 'build-bluekit' after 79 ms
[11:15:25] Starting 'watch-bluekit'...
Watching BlueKit in and automatically rebuilding on paths:
components/Test/**/*.js
[11:15:25] Finished 'watch-bluekit' after 10 ms

Updating the task definition to include a callback param seems to fix the issue. i.e. at src/createBlueKit.js#L128:

gulpRuntime.task(watchCommandName, (callback) => {
  watch();
})
@imtoo imtoo mentioned this issue Nov 23, 2016
@imtoo
Copy link
Contributor

imtoo commented Nov 23, 2016

It was only wrong console.log but the callback fixed it. Thanks!

@imtoo imtoo closed this as completed Nov 23, 2016
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

2 participants