-
-
Notifications
You must be signed in to change notification settings - Fork 413
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
gulp plugin for retire? #82
Comments
Have you tried using retire.js directly in your gulpfile? Usually you don`t need a plugin in gulp for tasks ( see gulp plugin guidelines), you just use the node modules directly. I haven't tried this myself.. we should probably have an example configuration in the readme. |
Sounds like something we definitely should do! |
Just wanted to share my two cents: @kozmic, you're definitely right, if you can use a node module directly, you could probably whip up a custom task pretty easily. Thats a problem for retire.js though, because (correct me if i'm wrong) as far as I can tell, there is no exported function from the retire package that you can use for this. The only way of doing this would be taking a lot of code from the cli wrapper and putting it into a custom gulp task. So for that matter, a gulp plugin might be a considerable option. That being said, there is always the option of keeping it very simple and just use the cli to run when a .js file, the bower.json or package.json file changes. Which could look something like this: gulp.task('retire', function (done) {
gulp.watch('package.json', function() {
child_process.spawn('retire', ['--node'], {
stdio: 'inherit'
}).once('close', done);
});
}); With a few simple adjustments you could send the streamed response data from the process to the gulp log. Personally, I'm not thrilled by spawning child processes to run bash stuff, but then again, as log as there is no real way to talk to retire through a require, this might be the best option. Also, even if you were able to talk directly to retire, you still couldn't use gulp's piping system to its full potential because retire will read the file content again instead of taking it from the gulp pipe. I'd be happy to whip up an example gulp task for this repo, let me know if you agree with my conclusions (or if you don't :) |
@jellekralt I agree with all your comments. Until we have time to refactor the API from retire.js, so it can be used easly with gulp, I would really appreciate an update to Readme.md with an gulp example :) |
One small question regarding to the usage of |
@peterkr You don't need it globally installed, it can be included in devDependencies. But note that then the As an example,
|
Anyone got a gulp-plugin for retire? If not, when can we see it? Could make one myself, but don't got much time at the moment :/
The text was updated successfully, but these errors were encountered: