Commit 4a1c2200 authored by Philipp Nowinski's avatar Philipp Nowinski
Browse files

[FEATURE] add javascript task

parent 33cf23ec
......@@ -119,6 +119,16 @@ module.exports = yeoman.generators.Base.extend((function() {
this.destinationPath('gulp/browser-sync.js'),
answers
);
this.fs.copyTpl(
this.templatePath('gulp/images.js'),
this.destinationPath('gulp/images.js'),
answers
);
this.fs.copyTpl(
this.templatePath('gulp/javascript.js'),
this.destinationPath('gulp/javascript.js'),
answers
);
};
Generator.writeCompassConfig = function() {
......@@ -144,6 +154,13 @@ module.exports = yeoman.generators.Base.extend((function() {
);
};
Generator.writeJavascript = function() {
this.fs.copy(
this.templatePath('_main.js'),
this.destinationPath(answers.javascriptPath + '/main.js')
);
};
Generator.writeDirectories = function() {
this.mkdir(this.destinationPath('images'));
this.mkdir(this.destinationPath('fonts'));
......
......@@ -2,8 +2,6 @@
var gulp = require('gulp'),
path = require('path'),
imagemin = require('gulp-imagemin'),
jshint = require('gulp-jshint'),
argv = require('yargs').argv<% if (projectType == 'typo3Frontend') { %>
extension = (function() {
if (typeof argv.ext === 'undefined') {
......@@ -13,17 +11,3 @@ var gulp = require('gulp'),
}())<% } %>;
require('require-dir')('./gulp');
gulp.task('jshint', function() {
return gulp.src(jsPath + '/**/*.js')
.pipe(jshint.reporter('jshint-stylish'));
});
gulp.task('images', function() {
return gulp.src(imagePath + '/**/*')
.pipe(imagemin({
progressive: true,
svgoPlugins: [{removeViewBox: false}]
}))
.pipe(gulp.dest(imagePath));
});
'use strict';
console.log('Sgalinski says \'allo, \'allo');
......@@ -13,6 +13,9 @@
"gulp-minify-css": "^0.3.11",
"gulp-imagemin": "^2.1.0",
"gulp-jshint": "^1.9.0",
"jshint-stylish": "^1.0.0",
"gulp-concat": "^2.4.3",
"gulp-uglify": "^1.0.2",
"require-dir": "^0.1.0",
"yargs": "^1.3.3"
}
......
'use strict';
var gulp = require('gulp'),
settings = require('./settings'),
imagemin = require('gulp-imagemin');
gulp.task('images', function() {
return gulp.src(settings.path.imagePath + '/**/*')
.pipe(imagemin({
progressive: true,
svgoPlugins: [{removeViewBox: false}]
}))
.pipe(gulp.dest(settings.path.images));
});
'use strict';
var gulp = require('gulp'),
settings = require('./settings'),
jshint = require('gulp-jshint'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify');
gulp.task('jshint', function() {
return gulp.src(settings.path.javascript + '/**/*.js')
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'));
});
gulp.task('javascript', function() {
return gulp.src(settings.path.javascript + '/**/*.js')
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'))
.pipe(concat('main.js'))
.pipe(uglify())
.pipe(gulp.dest('./'));
});
......@@ -3,6 +3,7 @@ module.exports = {
css: '<%= cssPath %>',
sass: '<%= sassPath %>',
javascript: '<%= javascriptPath %>',
compassConfig: '<%= compassConfigPath %>'
compassConfig: '<%= compassConfigPath %>',
images: '<%= imagesPath %>'
}
};
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment