Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var
lessPath,
stream,
compressedStream,
uncompressedStream,
isDefinition,
isPackagedTheme,
isSiteTheme,
isConfig
;
// log modified file
gulp.src(file.path)
.pipe(print(log.modified))
;
/*--------------
Find Source
---------------*/
// recompile on *.override , *.variable change
isConfig = (file.path.indexOf('theme.config') !== -1 || file.path.indexOf('site.variables') !== -1);
isPackagedTheme = (file.path.indexOf(source.themes) !== -1);
isSiteTheme = (file.path.indexOf(source.site) !== -1);
isDefinition = (file.path.indexOf(source.definitions) !== -1);
if(isConfig) {
// console.info('Rebuilding all files');
// cant rebuild paths are wrong
// gulp.start('build-docs');
var
lessPath,
stream,
compressedStream,
uncompressedStream,
isDefinition,
isPackagedTheme,
isSiteTheme,
isConfig
;
// log modified file
gulp.src(file.path)
.pipe(print(log.modified))
;
/*--------------
Find Source
---------------*/
// recompile on *.override , *.variable change
isConfig = (file.path.indexOf('theme.config') !== -1 || file.path.indexOf('site.variables') !== -1);
isPackagedTheme = (file.path.indexOf(source.themes) !== -1);
isSiteTheme = (file.path.indexOf(source.site) !== -1);
isDefinition = (file.path.indexOf(source.definitions) !== -1);
if(isConfig) {
console.info('Rebuilding all UI');
// impossible to tell which file was updated in theme.config, rebuild all
gulp.start('build-css');
var
lessPath,
stream,
compressedStream,
uncompressedStream,
isDefinition,
isPackagedTheme,
isSiteTheme,
isConfig
;
// log modified file
gulp.src(file.path)
.pipe(print(log.modified))
;
/*--------------
Find Source
---------------*/
// recompile on *.override , *.variable change
isConfig = (file.path.indexOf('.config') !== -1);
isPackagedTheme = (file.path.indexOf(source.themes) !== -1);
isSiteTheme = (file.path.indexOf(source.site) !== -1);
isDefinition = (file.path.indexOf(source.definitions) !== -1);
if(isConfig) {
console.log('Change detected in theme config');
// cant tell which theme was changed in theme.config, rebuild all
var
lessPath,
stream,
compressedStream,
uncompressedStream,
isDefinition,
isPackagedTheme,
isSiteTheme,
isConfig
;
// log modified file
gulp.src(file.path)
.pipe(print(log.modified))
;
/*--------------
Find Source
---------------*/
// recompile on *.override , *.variable change
isConfig = (file.path.indexOf('theme.config') !== -1 || file.path.indexOf('site.variables') !== -1);
isPackagedTheme = (file.path.indexOf(source.themes) !== -1);
isSiteTheme = (file.path.indexOf(source.site) !== -1);
isDefinition = (file.path.indexOf(source.definitions) !== -1);
if(isConfig) {
console.info('Rebuilding all UI');
// impossible to tell which file was updated in theme.config, rebuild all
gulp.start('build-css');
var
lessPath,
stream,
compressedStream,
uncompressedStream,
isDefinition,
isPackagedTheme,
isSiteTheme,
isConfig
;
// log modified file
gulp.src(file.path)
.pipe(print(log.modified))
;
/*--------------
Find Source
---------------*/
// recompile on *.override , *.variable change
isConfig = (file.path.indexOf('.config') !== -1);
isPackagedTheme = (file.path.indexOf(source.themes) !== -1);
isSiteTheme = (file.path.indexOf(source.site) !== -1);
isDefinition = (file.path.indexOf(source.definitions) !== -1);
if(isConfig) {
console.log('Change detected in theme config');
// cant tell which theme was changed in theme.config, rebuild all
function copyExample() {
// copy src/ to server
console.info('Copying examples');
return gulp.src('examples/**/*.*')
.pipe(gulp.dest(output.examples))
.pipe(print(log.created));
}
.on('all', function (event, path) {
// We don't handle deleted files yet
if (event === 'unlink' || event === 'unlinkDir') {
return;
}
return gulp.src(path, {
base: 'src/'
})
.pipe(gulp.dest(config.paths.output.less))
.pipe(print(log.created))
;
})
;
gulp.task('debug-build', ['inject'], function(cb) {
gulp.src('../../../src/main/webapp/wegas-lobby/**/*.js')
.pipe($.cache($.uglify().on("error", function(error) {
console.log("Error: " + error);
}))).pipe(print());
return gulp.src(paths.tmp + '/serve/*.jsp')
.pipe($.useref())
.pipe(gulp.dest(paths.dist + '/'))
.pipe($.size({
title: paths.dist + '/',
showFiles: true
}));
});
gulp.task('images', function() {
function typescript_build(src, dest) {
return gulp.src(src + '/**/*.ts')
.pipe(sourcemaps.init())
.pipe(babel({
root: __dirname
}))
.pipe(rename({suffix: '.src'}))
.pipe(gulp.dest(dest))
.pipe(uglify())
.pipe(rename(function (path) {
path.basename = path.basename.replace(/\.src/, '');
}))
.pipe(sourcemaps.write('.', {addComment: false, includeContent: false}))
.pipe(gulp.dest(dest))
.pipe(print());
}
function build(src, config) {
return gulp.src(src, {base: config.paths.source.themes})
.pipe(gulpif(config.hasPermissions, chmod(config.parsedPermissions)))
.pipe(gulp.dest(config.paths.output.themes))
.pipe(print(log.created))
;
}