本文整理匯總了TypeScript中gulp-typescript.default函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript default函數的具體用法?TypeScript default怎麽用?TypeScript default使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了default函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: compile
function compile(isRelease: boolean) {
var tsProject = ts.createProject({
removeComments: true, // Do not emit comments to output.
//noImplicitAny: false, // Warn on expressions and declarations with an implied 'any' type.
//noLib: false, // Don't include the default lib (with definitions for - Array, Date etc)
//noEmitOnError: false, // Do not emit outputs if any type checking errors were reported.
//target: "ES3", // Specify ECMAScript target version: 'ES3' (default), 'ES5' or 'ES6'.
//module: "", // Specify module code generation: 'commonjs' or 'amd'
//sourceRoot: "", // Specifies the location where debugger should locate TypeScript files instead of source locations.
declarationFiles: false, // Generates corresponding .d.ts files.
noExternalResolve: false, // Do not resolve files that are not in the input. Explanation below.
sortOutput: true, // Sort output files. Usefull if you want to concatenate files (see below).
});
var tsResult = gulp.src(srcGlob)
.pipe(ts(tsProject, { referencedFrom: ['Application.ts'] }));
return tsResult.js
.pipe(concat('app.js'))
//.pipe(ngAnnotate())
//.pipe(gulpIf(isRelease, uglify()))
//.pipe(uglify())
.pipe(gulp.dest('Chokaigi2015/html/js'));
}
示例2: function
gulp.task('buildServer' ,['clearBuildDir'], function () {
var typescript = require('gulp-typescript');
var tscConfig = require('./tsconfig.json');
var tScriptResult = gulp.src(PATHS.src)
.pipe(typescript(tscConfig.compilerOptions));
return tScriptResult.js.pipe(gulp.dest('build/'));
});
示例3: merge
gulp.task("compile", function() {
var tsResult = tsProject.src()
.pipe(sourcemaps.init())
.pipe(ts(tsProject));
var dts = tsResult.dts
.pipe(insert.transform(function(contents: string, file: any) {
contents = contents.replace(/\/\/\/\s*\<reference path=".*"\s*\/\>\s*\n/ig, "");
contents += "declare module \"updraft\" {\n" +
" export = Updraft;\n" +
"}\n";
return contents;
}));
dts = tsResult.dts.pipe(gulp.dest("./"));
var js = tsResult.js;
js = js.pipe(insert.transform(function(contents: string, file: any) {
contents = contents.replace(/(Updraft = {})/g, "/* istanbul ignore next */ $1");
contents = contents.replace(/(var _a(,|;))/g, "/* istanbul ignore next */ $1");
return contents;
}));
if(minify) {
js = js.pipe(uglify());
}
js = js
.pipe(sourcemaps.write("./"))
.pipe(gulp.dest("./"));
return merge([dts, js]);
});
示例4:
gulp.task('!build:commonjs', () => gulp
.src([
'src/**/*.ts',
'typings/browser/**/*.d.ts'
])
.pipe(ts(commonCompilerConfig))
.pipe(gulp.dest('dist/src')));
示例5:
gulp.task("compile", () => {
var tsResult = gulp.src("src/**/*.ts")
.pipe(sourcemaps.init())
.pipe(tsc(tsProject));
return tsResult.js
.pipe(gulp.dest("../webapp"));
});
示例6: function
gulp.task('compile-typescript', function () {
var streamFinished = function () {
gutil.log('End stream');
};
var entry = config.paths.app + '/main.ts';
var fileName = path.basename(entry, path.extname(entry)) + ".js";
return gulp.src(entry)
.pipe(ts({
target: "ES5",
noImplicitAny: false,
moduleResolution: "node",
outFile: fileName,
removeComments: true,
experimentalDecorators: true
}))
.pipe(wrap({ src: 'template.txt' }))
.pipe(rename({ suffix: '.debug' }))
.pipe(gulp.dest(config.paths.pub))
.pipe(uglify())
.pipe(rename(fileName))
.pipe(gulp.dest(config.paths.pub))
.on('end', streamFinished);
//.pipe(wrap('(function($){\n"use strict";\n<%= contents %>\n})(jQuery);'))
//.pipe(rename(fileName))
});
示例7: compilePublic
function compilePublic() {
gulp.src(pathToPublicTs)
.pipe(sourcemaps.init())
.pipe(tsc(new tsconfig('system', true, true)))
.pipe(sourcemaps.write())
.pipe(gulp.dest('./public'));
}
示例8: compileServer
function compileServer() {
gulp.src(pathToServerTs)
.pipe(sourcemaps.init())
.pipe(tsc(new tsconfig('commonjs', null, null)))
.pipe(sourcemaps.write())
.pipe(gulp.dest('./server'));
}
示例9: function
gulp.task('build-release', ['vet', 'clean-code'], function() {
console.log('Compiling Typescript files for Release');
return gulp
.src(config.sourceTs)
.pipe(tsc(config.tsc))
.pipe(gulp.dest(config.build));
}
示例10: require
gulp.task('karma:build', () => {
const typescript = require('gulp-typescript');
const sourcemaps = require('gulp-sourcemaps');
const tplinline = require('gulp-inline-ng2-template');
const errors = require('../utils/errors');
const paths = require('../config/paths');
const config = {
typescript: require('../config/typescript'),
tplinline: require('../config/tplinline')
};
const tsProject = typescript.createProject(paths.typescript.appConfig, config.typescript);
return gulp
.src([
paths.typings,
paths.sources.scripts,
'!' + paths.sources.bootstrap,
'!' + paths.scripts.tests.e2e
])
.pipe(sourcemaps.init())
.pipe(tplinline(config.tplinline))
.pipe(typescript(tsProject))
.js
.pipe(sourcemaps.write())
.on('error', errors)
.pipe(gulp.dest(paths.output.app));
});