Example #1
0
 @Task('useref')
 useref() {
     return gulp.src('app/*.html')
         .pipe(useref())
         .pipe(gulpIf('*.js', uglify()))
         .pipe(gulpIf('*.css', cssnano()))
         .pipe(gulp.dest('dist'))
 }
Example #2
0
 /**
  * See: GulpTask::createStream().
  *
  * @param {GulpfileInputConfiguration[]} inputs
  *
  * @returns {object}
  */
 protected createStream(inputs: GulpfileInputConfiguration[]): any {
     const env = this.gulpfile.options.env;
     const stream: any = super.createStream(inputs);
     if (stream !== null) {
         return stream
             .pipe(gulpif(env === 'dev', sourcemaps.init()))
             .pipe(gulpif(env === 'prod', uglifycss()))
             .pipe(gulpif(env === 'dev', relativeSourcesmaps({dest: 'tmp'})))
             .pipe(concat(FileSystem.getRelativePath(FileSystem.getDirectoryName(this.outputPath), this.outputPath)))
             .pipe(gulpif(env === 'dev', sourcemaps.write()))
             .pipe(this.gulpfile.gulp.dest(FileSystem.getDirectoryName(this.outputPath)));
     }
     return null;
 }
Example #3
0
gulp.task("scripts:coffee", () => {
  return gulp.src('./src/coffee/**/*.coffee')
    .pipe(gulpif(argv.incremental, newer({dest: paths.buildDir.jsTree, ext: '.js'})))
    .pipe(coffee({bare: true}))
    .pipe(rename((path) => path.extname = '.ts'))
    .pipe(gulp.dest(paths.buildDir.jsTree + '_ts'))
})
Example #4
0
    () => {

        return gulp.src(stylesSource)
            .pipe(sass())
            .pipe(gulpif(minify, csso()))
            .pipe(gulp.dest(DEST_DIR));

    }
Example #5
0
    () => {

        return gulp.src(config.bootstrapSource)
            .pipe(concat('bootstrap.js.dist'))
            .pipe(gulpif(minify, uglify()))
            .pipe(gulp.dest(APP_DIR + '/Resources/container-lib'));

    }
Example #6
0
    () => {

        return gulp.src(config.containerSource)
            .pipe(concat('library.js.dist'))
            .pipe(gulpif(minify, uglify().on('error', gutil.log)))
            .pipe(gulp.dest(APP_DIR + '/Resources/container-lib'));

    }
Example #7
0
    () => {

        var filename = debuggerIndexFile,
            filePath = path.resolve(__dirname, filename),
            source = fs.readFileSync(filePath, 'utf8');

        var tpl = html2js(source, {
            mode: 'default',
            wrap: false
        });

        return gulp.src(SOURCE_DIR + '/' + DEBUGGER_NAMESPACE + '/debug.js')
            .pipe(template({
                template: tpl
            }))
            .pipe(gulpif(minify, uglify()))
            .pipe(gulpif(env === 'dev', replace(/##host##/g, `${baseUrl}container-debugger`)))
            .pipe(gulp.dest(DEST_DIR + '/' + DEBUGGER_NAMESPACE));

    }
Example #8
0
 gulp.task('TypeScript compilation', () => {
   return gulp
     .src(['**/*.ts', '!node_modules/**/*.ts'], { base: '.' })
     .pipe(ts(tsConfig.compilerOptions))
     .pipe(gulpif(params.env !== 'production', notify({
       title: 'TypeScript compiled',
       message: 'Thank you for being progressive!',
       icon: path.join(__dirname, 'icons/gulp/ts.png'),
       onLast: true
     })))
     .pipe(gulp.dest('./dist'));
 });
Example #9
0
    () => {

        return templatesJadeBuild(indexSource)
            .pipe(gulpif(env === 'dev', gulp.dest(DEST_DIR + '/' + ADMIN_NAMESPACE)))
            .pipe(rename('index.php'))
            .pipe(htmlreplace({
                'pluginsjstop' : '<?php $pathTop = __DIR__.\'/../../var/cache/seventagPluginsJavascriptTop.php\'; if(is_file($pathTop)) { require_once $pathTop; } ?>',
                'pluginsjsbottom' : '<?php $pathBottom = __DIR__.\'/../../var/cache/seventagPluginsJavascriptBottom.php\'; if(is_file($pathBottom)) { require_once $pathBottom; } ?>',
                'oauthsettings' : '<?php $path = __DIR__.\'/../../var/cache/OAuthClientSettings.php\'; if(is_file($path)) { require_once $path; } ?>'
            }))
            .pipe(gulp.dest(DEST_DIR + '/' + ADMIN_NAMESPACE));

    }
Example #10
0
    () => {

        let bowerDeps = wiredep({
            dependencies: true,
            devDependencies: env !== 'prod'
        });

        return gulp.src(bowerDeps.js, {base: 'bower_components'})
            .pipe(concat('vendor.js'))
            .pipe(gulpif(minify, uglify().on('error', gutil.log)))
            .pipe(gulp.dest(DEST_DIR + '/' + DEBUGGER_NAMESPACE));

    }