UNPKG

@sammwy/milkshake

Version:

<p align="center"> <img src="https://raw.githubusercontent.com/sammwyy/milkshake/master/docs/milkshake.png" height="64px"> <h1 align="center">MilkShake</h1> <p align="center"> <b>Automatize Tasks, Compile, concatenate and minify automaticall

28 lines (24 loc) 932 B
const bundler = require("./bundler"); function tasks (config) { let { cssTask, sassTask, stylusTask, lessTask, jsTask, imageTask } = config; buildTask("css", cssTask); buildTask("js", jsTask); buildTask("image", imageTask); buildTask("sass", sassTask); buildTask("less", lessTask); buildTask("stylus", stylusTask); } function buildTask (name, task) { if (task != null) { let { source, main, dist, messageEnd } = task; if (source == null) { throw "sorce parameter in " + name + "Task must be defined" } else if (dist == null) { throw "dist parameter in " + name + "Task must be defined" } bundler.watchAndCompile(name, source, dist, main, task.useES6, () => { if (messageEnd) { console.log(messageEnd); } }); } } exports.watchAndCompile = bundler.watchAndCompile; exports.tasks = tasks;