This is exactly what I do… I created two setups, basically this which uses plain CLI tools via NPM scripts, or this which uses Laravel Mix. i built them to work with my framework, but they will work with anything.
I didn’t know npm script, thanks for the advice, I will take a look.
I tried to add just three css files in a test project and ParcelJS generate three corresponding js files. I didn’t understand why and didn’t want to spend to much time on it.
Parceljs seems more dedicated to JS web app than just minify and purge css.
You should definitely try npm out. Actually it’s just perfect for what you describe: postcss, sass, minifying and combining stuff, … If I shouldn’t have convinced you entirely, check out chokidar-cli too in this context: you can run watchers with it so your npm scripts can run automatically when a file in the filetree you’re watching is changed.
The links James mentioned are a good way for checking out how he did it.
The biggest eye opener for me was reducing 1,200+ lines of Gulp code down to less then 20 lines of NPM scripts, for the same end result. Crazy!
Parallel shell is worth using too, particularly with watchers because you can only run one command consecutively with the CLI. It lets you run multiple instances of Chockidar (or any other command) concurrently.
@gillesvauvarin Awesome. You might want to take a look at this article, it’s what got me interested in the first place. He gives some nice tips & tricks on doing stuff you probably wouldn’t have thought you could use it for.