mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-16 05:49:16 +02:00
build css in development
This commit is contained in:
+24
-1
@@ -8,11 +8,33 @@ var json = require('rollup-plugin-json');
|
||||
var http = require('http');
|
||||
var gaze = require('gaze');
|
||||
var ecstatic = require('ecstatic');
|
||||
var glob = require('glob');
|
||||
var concat = require('concat-files');
|
||||
|
||||
function makeCSS() {
|
||||
glob('css/**/*.css', function (er, files) {
|
||||
if (er) console.error(er);
|
||||
concat(files, 'dist/iD.css', function (err) {
|
||||
if (err) console.error(err);
|
||||
console.log('css built');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
var building = false;
|
||||
var cache;
|
||||
if (process.argv[2] === 'develop') {
|
||||
|
||||
var isDevelopment = process.argv[2] === 'develop';
|
||||
|
||||
if (isDevelopment) {
|
||||
build();
|
||||
makeCSS();
|
||||
|
||||
gaze(['css/**/*.css'], function(err, watcher) {
|
||||
watcher.on('all', function() {
|
||||
makeCSS();
|
||||
});
|
||||
});
|
||||
|
||||
gaze(['modules/**/*.js', 'data/**/*.{js,json}'], function(err, watcher) {
|
||||
watcher.on('all', function() {
|
||||
@@ -28,6 +50,7 @@ if (process.argv[2] === 'develop') {
|
||||
|
||||
} else {
|
||||
build();
|
||||
makeCSS();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user