kaliop / gulp-assets-builder Goto Github PK
View Code? Open in Web Editor NEWA collection of configurable gulp tasks we use to build front-end code
License: MIT License
A collection of configurable gulp tasks we use to build front-end code
License: MIT License
We wanted to move away from desktop tools such as Prepros, CodeKit, Koala etc., to a build system that could be committed in each project (package.json
, config file, etc.).
We settled on gulp, and after a while we realized that our gulp tasks often had similar configuration: files to process with some tool(s), files to watch, and where to write the result. Also basic gulp tasks were not great at notifying users when things went wrong (or right), so we tried to improve that with notifications (both system notifications and console logs).
In the end, we refactored our code with two goals:
watch
tasks).We think it’s a nice example of how one can write gulp tasks with usability in mind, and it can work as a starting point to copy and build on top.
Don’t like the tasks we provide?
package.json
too, e.g. to avoid downloading useless Sass or PhantomJS binaries) and write your own.Not sure yet. We might publish the “helpers” part, but not the tasks themselves (except as examples in this repo).
In assets-builder/index.js
.
try {
builder = require('./tasks/' + key + '.js')
var taskNames = register(config[key], key, builder)
activeTasks = activeTasks.concat(taskNames)
}
catch(err) {
var filename = path.basename(__dirname) + '/tasks/' + key + '.js'
notify({
title: 'Ignoring \''+ key + '\' config',
message: 'No task at \'' + filename + '\''
})
}
Intent was to catch errors when user defines a config key that matches no tasks/key.js
file, but if the file does exist but requiring it throws an error (apparently some JS modules do that), the error is silent.
Instead, maybe look for tasks/key.js
, ignore and warn if missing, and require otherwise (letting any error go through).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.