gulp.task(id, ['concatjsfs', 'concatjsfsdocs', 'concatjsdocs'], function() { return gulp.src('./src/pages/*.html') .pipe(linker(linker_params('./dist/js/fs.js', 'FSJS', 'dist/'))) .pipe(linker(linker_params('./dist/js/fsdocs.js', 'FSDOCSJS', 'dist/'))) .pipe(linker(linker_params('./dist/js/docs.js', 'DOCSJS', 'dist/'))) .pipe(gulp.dest('./dist/')); });
gulp.task(id, function() { return gulp.src('./src/pages/*.html') .pipe(linker(linker_params(fsdocs.js, 'FSDOCSJS', '.'))) .pipe(linker(linker_params(fs.js('dev'), 'FSJS', '.'))) .pipe(linker(linker_params(docs.js, 'DOCSJS', '.'))) .pipe(gulp.dest('./dist/')); });
gulp.task('link-js', [ 'build-js' ], function( ) { var isProduction = args.production; return gulp.src('./index.html') .pipe(linker({ scripts: isProduction || args.devtest ? [(frontend_exportJS + '/' + frontend_minifileJS)] : [ // Force the order of files to link (frontend_srcJS + '/lib/*.js'), (frontend_srcJS + '/app.js'), (frontend_srcJS + '/*.js'), (frontend_srcJS + '/models/*.js'), (frontend_srcJS + '/common/*.js'), (frontend_srcJS + '/common/service/*.js'), (frontend_srcJS + '/common/factory/*.js'), (frontend_srcJS + '/common/directive/*.js'), (frontend_srcJS + '/module/**/module.js'), (frontend_srcJS + '/module/**/route.js'), (frontend_srcJS + '/module/**/*.js') ], startTag: '<!-- APP -->', endTag: '<!-- END APP -->', fileTmpl: isProduction || args.devtest ? '<script src="../%s"></script>' : '<script src="../%s"></script>', appRoot: 'static/' })) .pipe(gulp.dest('./')); });
gulp.task('linker', function() { return gulp.src('app/index.html') .pipe(linker({ scripts: 'app/scripts/**/*.js', startTag: '<!--SCRIPTS-->', endTag: '<!--SCRIPTS END-->', fileTmpl: '<script src="%s"></script>', appRoot: 'app/' })) .pipe(gulp.dest('app/')); });
gulp.task('linker-dev', function() { return gulp.src(path.resolve(__dirname, '../index.html')) .pipe(linker({ scripts: config.sourceMap, startTag: '<!--SCRIPTS-->', endTag: '<!--SCRIPTS END-->', fileTmpl: '<script src="%s"></script>', appRoot: config.appRoot })) .pipe(gulp.dest('./')); });
gulp.task('linker', function() { return gulp.src('app/index.html') .pipe(plumber({ errorHandler: onError })) .pipe(linker({ scripts: ['app/scripts/**/*.js', '!app/scripts/app.js', '!app/scripts/**/*_test.js'], startTag: '<!--SCRIPTS-->', endTag: '<!--SCRIPTS END-->', fileTmpl: '<script src="%s"></script>', appRoot: 'app/' })) .pipe(gulp.dest('app/')); });
gulp.task('insert', function () { return gulp.src(INDEX_HTML_PATH) .pipe(debug()) // Link the JavaScript .pipe(linker({ scripts: APP_JS_FILES, startTag: '<!--js-->', endTag: '<!--js end-->', fileTmpl: '<script src="%s"></script>', appRoot: APP_ROOT })) .pipe(linker({ scripts: CSS_APP_FILES, startTag: '<!--css-->', endTag: '<!--css end-->', fileTmpl: '<link rel="stylesheet" href="%s" type="text/css" />', appRoot: APP_ROOT })) // Write modified files to www/ .pipe(gulp.dest(APP_ROOT)); });
gulp.task('link-css', [ 'build-css' ], function( ) { var isProduction = args.production; return gulp.src('./index.html') .pipe(linker({ scripts: isProduction || args.devtest ? [(frontend_exportCSS + '/' + frontend_minifileCSS)] : [(frontend_exportCSS + '/style.css')], startTag: '<!-- STYLE -->', endTag: '<!-- END STYLE -->', fileTmpl: isProduction || args.devtest ? '<link href="%s" rel="stylesheet"/>' : '<link href="%s" rel="stylesheet"/>', appRoot: 'static/' })) .pipe(gulp.dest('./')); });
gulp.task('linker', function(){ var linker = require('gulp-linker'); gulp.src('views/layout.jade') .pipe(linker({ scripts : [ require('../pipeline.js').bower , require('../pipeline.js').js ] , startTag : '<!--SCRIPTS-->' , endTag : '<!--SCRIPTS END-->' , fileTmpl : 'script(src="%s")' , appRoot : 'assets/' })) .pipe(gulp.dest('views/')); });
gulp.task('html', ['javascript', 'styles'], function() { return gulp.src(buildConfig.dev.globs.html) .pipe(linker({ scripts: buildConfig.dev.globs.vendor.css, startTag: '<!--STYLES:VENDOR-->', endTag: '<!--STYLES END-->', fileTmpl: '<link rel="stylesheet" href="%s"/>', appRoot: '', relative: true })) .pipe(linker({ scripts: ['build/styles.css'], startTag: '<!--STYLES-->', endTag: '<!--STYLES END-->', fileTmpl: '<link rel="stylesheet" href="%s"/>', appRoot: 'build', relative: true })) .pipe(linker({ scripts: buildConfig.dev.globs.vendor.javascript, startTag: '<!--SCRIPTS:VENDOR-->', endTag: '<!--SCRIPTS END-->', fileTmpl: '<script src="%s"></script>', appRoot: '', relative: true })) .pipe(linker({ scripts: ['build/app.js'], startTag: '<!--SCRIPTS-->', endTag: '<!--SCRIPTS END-->', fileTmpl: '<script src="%s"></script>', appRoot: 'build', relative: true })) .pipe(gulp.dest(buildConfig.dev.buildDir)); });