creating src/ + dist/, adding gulp tasks

This commit is contained in:
Alex Vernacchia
2015-01-07 18:13:52 +00:00
parent abd84f7fcb
commit e8d1d91fb6
14 changed files with 126 additions and 9 deletions
+1 -1
View File
@@ -11,7 +11,7 @@
"laxbreak": true,
"laxcomma": true,
"newcap": true,
"node": false,
"node": true,
"shadow": false,
"strict": true,
"undef": true,
+1
View File
@@ -1,6 +1,7 @@
.*
*.log
bower.json
gulp
gulpfile.js
index.html
test.js
+1
View File
@@ -20,6 +20,7 @@
"ignore": [
"**/.*",
"bower_components",
"gulp"
"index.html",
"node_modules",
"test",
+6
View File
@@ -0,0 +1,6 @@
.scheduler {
color: #000;
}
.scheduler .something-inside-schedler {
background: #efefef;
}
+1
View File
@@ -0,0 +1 @@
.scheduler{color:#000;}.scheduler .something-inside-schedler{background:#efefef}
View File
+1
View File
@@ -0,0 +1 @@
!function(){"use strict"}();
+16
View File
@@ -0,0 +1,16 @@
'use strict';
var config = {};
config.paths = { src: {}, dist: {} };
config.paths.src.base = './src/';
config.paths.src.css = config.paths.src.base + 'css/';
config.paths.src.js = config.paths.src.base + 'js/';
config.paths.src.stylus = config.paths.src.base + 'stylus/';
config.paths.dist.base = './dist/';
config.paths.dist.css = config.paths.dist.base + 'css/';
config.paths.dist.js = config.paths.dist.base + 'js/';
module.exports = config;
+73 -7
View File
@@ -1,13 +1,79 @@
'use strict';
var gulp = require( 'gulp' );
var jshint = require( 'gulp-jshint' );
var gulp = require( 'gulp' );
var jshint = require( 'gulp-jshint' );
var rename = require( 'gulp-rename' );
var runSequence = require( 'run-sequence' );
var stylus = require( 'gulp-stylus' );
var uglify = require( 'gulp-uglify' );
// not sure if we'll use nib, but probably should add it
var nib = require( 'nib' );
gulp.task('jshint', function() {
gulp.src( ['./scheduler.js', './test.js'] )
.pipe( jshint('./.jshintrc') )
.pipe( jshint.reporter( 'jshint-stylish' ) );
var gulpConfig = require( './gulp/config' );
var paths = gulpConfig.paths;
var stylusOptions = {
use: nib()
, compress: false
};
gulp.task( 'default', function( cb ) {
runSequence( 'jshint', 'release', cb );
});
// will add tasks for min and other stuff
gulp.task( 'release', [ 'stylus', 'stylus:compress', 'uglify', 'copySrcFiles' ] );
gulp.task( 'watch', function() {
gulp.watch( paths.src.stylus + '**/*', [ 'stylus' ] );
});
gulp.task( 'jshint', function() {
var files = [
'./gulpfile.js'
, './test.js'
, paths.src.js + 'scheduler.js'
];
return gulp.src( files )
.pipe( jshint( './.jshintrc' ) )
.pipe( jshint.reporter( 'jshint-stylish' ) )
.pipe( jshint.reporter( 'fail' ) );
});
gulp.task( 'uglify', function() {
return gulp.src( [ paths.src.js + 'scheduler.js' ] )
.pipe( uglify() )
.pipe( rename({
extname: '.min.js'
}))
.pipe( gulp.dest( paths.dist.js ) );
});
gulp.task( 'stylus', function() {
stylusOptions.compress = false;
return gulp.src( [ paths.src.stylus + 'scheduler.styl' ] )
.pipe( stylus( stylusOptions ) )
.pipe( gulp.dest( paths.src.css ) );
});
gulp.task( 'stylus:compress', function() {
stylusOptions.compress = true;
return gulp.src( [ paths.src.stylus + 'scheduler.styl' ] )
.pipe( stylus( stylusOptions ) )
.pipe( rename({
extname: '.min.css'
}))
.pipe( gulp.dest( paths.dist.css ) );
});
gulp.task( 'copySrcFiles', function() {
gulp.src( [ paths.src.js + '**/*' ] )
.pipe( gulp.dest( paths.dist.js ) );
gulp.src( [ paths.src.css + '**/*' ] )
.pipe( gulp.dest( paths.dist.css ) );
});
+6 -1
View File
@@ -25,6 +25,11 @@
"devDependencies": {
"gulp": "^3.8.10",
"gulp-jshint": "^1.9.0",
"jshint-stylish": "^1.0.0"
"gulp-rename": "^1.2.0",
"gulp-stylus": "^1.3.4",
"gulp-uglify": "^1.0.2",
"jshint-stylish": "^1.0.0",
"nib": "^1.0.4",
"run-sequence": "^1.0.2"
}
}
+6
View File
@@ -0,0 +1,6 @@
.scheduler {
color: #000;
}
.scheduler .something-inside-schedler {
background: #efefef;
}
+1
View File
@@ -0,0 +1 @@
.scheduler{color:#000;}.scheduler .something-inside-schedler{background:#efefef}
+5
View File
@@ -0,0 +1,5 @@
(function() {
'use strict';
// we'll get there don't worry
})();
+8
View File
@@ -0,0 +1,8 @@
.scheduler {
// following is just testing
color: #000;
.something-inside-schedler {
background: #efefef;
}
}