Commit 5146b97a authored by Philipp Nowinski's avatar Philipp Nowinski
Browse files

[BUGFIX] fix path related issues

parent a332b810
......@@ -110,7 +110,7 @@ module.exports = yeoman.generators.Base.extend((function() {
{
type: 'input',
name: 'maxCssFileSize',
message: 'Specify a maximum size (in Bytes) for CSS files. Leave blank if you don\'t want to' +
message: 'Specify a maximum size (in Bytes) for CSS files. Leave blank if you don\'t want to ' +
'specify a limit',
default: ''
}
......@@ -138,7 +138,7 @@ module.exports = yeoman.generators.Base.extend((function() {
{
type: 'input',
name: 'maxJsFileSize',
message: 'Specify a maximum size (in Bytes) for JavaScript files. Leave blank if you don\'t want to' +
message: 'Specify a maximum size (in Bytes) for JavaScript files. Leave blank if you don\'t want to ' +
'specify a limit',
default: ''
}
......
......@@ -11,18 +11,21 @@ require('require-dir')('./gulp');
gulp.task('watch', function() {
var sassWatchers = [];
for (var i = config.extensions.length; i--;) {
gulp.watch(
'typo3conf/ext/' + [config.extensions[i] + '/' + config.directories.sass + '/**/*.scss', '!**/_sprite.scss'],
['css']).on('change', function(file) {
sassWatchers.push('typo3conf/ext/' + config.extensions[i] + '/' + config.directories.sass + '/**/*.scss');
}
sassWatchers.push('!**/_sprite.scss');
gulp.watch(sassWatchers, ['css']).on('change', function(file) {
settings.setExtension(getExtensionName(file, config.directories.sass));
}
);
}
for (i = config.extensions.length; i--;) {
gulp.watch(
'typo3conf/ext/' + [config.extensions[i] + '/' + config.directories.javascript + '/**/*.js'],
['typo3conf/ext/' + config.extensions[i] + '/' + config.directories.javascript + '/**/*.js'],
['javascript']).on('change', function(file) {
settings.setExtension(getExtensionName(file, config.directories.javascript));
}
......@@ -37,7 +40,7 @@ gulp.task('default', function() {
function getExtensionName(changedFile, task) {
var extension = changedFile.path.split(task)[0];
var extension = changedFile.path.split('/' + task)[0].split('typo3conf/ext/')[1];
gutil.log(chalk.green('Change in "') + chalk.magenta(path.relative('.', changedFile.path)) + chalk.green('"'));
return extension;
}
......@@ -24,13 +24,13 @@ var gulp = require('gulp'),
gulp.task('css', ['hash-sprites'], function() {
var path = require('path');
return gulp.src(settings.path().sass + '/**/*.scss')
.pipe(cssImageDimensions(settings.path().images))
.pipe(cssImageDimensions(path.resolve(settings.path().images)))
.pipe(sourcemaps.init())
.pipe(sass({errLogToConsole: true}))
.pipe(cssImport())
.pipe(autoprefixer(<%= autoprefixerBrowserSelection %>))<% if (minifyCss) { %>
.pipe(minifyCss())<% } %>
.pipe(sourcemaps.write('../sourcemaps'))
.pipe(sourcemaps.write('../SourceMaps'))
.pipe(gulp.dest(settings.path().css))
.pipe(filter('**/*.css'))
.pipe(checkFilesize(<%= maxCssFileSize %>))
......
Markdown is supported
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