Closed bernhardw closed 10 years ago
What about using something like gulp or watchify to handle that ?
Example with gulp
// $ npm i gulp gulp-util gulp-plumber gulp-myth
var gulp = require("gulp")
var util = require("gulp-util")
var plumber = require("gulp-plumber")
var myth = require("gulp-myth")
var watch = false // to enable plumber just during watch
gulp.task("styles", function() {
// handle all CSS at the root of the folder as stylesheets
return gulp.src("./src/css/*.css")
.pipe(watch ? plumber() : util.noop())
.pipe(myth())
.pipe(gulp.dest("./dist/css/"))
})
gulp.task("default", ["styles"], function() {
watch = true
// watch all CSS to reload the task
gulp.watch("./src/css/**/*", ["styles"])
})
You're right MoOx, that makes more sense. Thanks!
I'm not sure how you handle it, but I usually have multiple separate CSS files and one
main.css
where I@import
all the others.The problem is, when working on those separate CSS files,
--watch
doesn't trigger andmain.css
isn't processed/updated.It would be great if
--watch
takes a file path as an optional argument, as an alternative to watch only the input file.node-watch
supports file and directory.Would you like me to create a PR?