本文整理匯總了TypeScript中gulp-notify.onError函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript onError函數的具體用法?TypeScript onError怎麽用?TypeScript onError使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了onError函數的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
gulp.task("jasmine", () => {
gulp.src("./spec/**/*.ts")
.pipe(plumber({errorHandler: notify.onError(buildErrorMessage)}))
.pipe(ts(tsProject))
.pipe(jasmine());
});
示例2: processCSS
export default function processCSS() {
return gulp.src(project.cssProcessor.source)
.pipe(changedInPlace({ firstPass: true }))
.pipe(plumber({ errorHandler: notify.onError('Error: <%= error.message %>') }))
.pipe(sourcemaps.init())
.pipe(less())
.pipe(build.bundle());
}
示例3: errors
export = function errors(errorObject: Object) {
notify
.onError(errorObject.toString().split(': ').join(':\n'))
.apply(this, arguments);
if (typeof this.emit === 'function') {
this.emit('end');
}
};
示例4: buildTypeScript
function buildTypeScript() {
typescriptCompiler = ts.createProject('tsconfig.json', {
typescript: require('typescript')
});
let src = gulp.src(project.transpiler.source).pipe(changedInPlace({ firstPass: true }));
return eventStream
.merge(src)
.pipe(plumber({ errorHandler: notify.onError('Error: <%= error.message %>') }))
.pipe(typescriptCompiler())
.pipe(gulpif(isJsFile, build.bundle()));
}
示例5: processMarkup
export default function processMarkup() {
return gulp.src(project.markupProcessor.source)
.pipe(plumber({errorHandler: notify.onError('Error: <%= error.message %>')}))
.pipe(changedInPlace({firstPass:true}))
.pipe(htmlmin({
removeComments: true,
collapseWhitespace: true,
minifyCSS: true,
minifyJS: true,
ignoreCustomFragments: [/\${.*?}/g] // ignore interpolation expressions
}))
.pipe(build.bundle());
}
示例6: buildJavaScript
function buildJavaScript() {
if (!typescriptCompiler) {
typescriptCompiler = typescript.create(require('../../tsconfig.json').compilerOptions);
}
return gulp.src(project.paths.dtsSource.concat(project.paths.source))
.pipe(plumber({errorHandler: notify.onError('Error: <%= error.message %>')}))
.pipe(changed(project.paths.output, {extension: '.js'}))
.pipe(sourcemaps.init({loadMaps: true}))
.pipe(typescriptCompiler())
.pipe(sourcemaps.write({includeContent: false, sourceRoot: '/src'}))
.pipe(gulp.dest(project.paths.output));
}
示例7: buildTypeScript
function buildTypeScript() {
if(!typescriptCompiler) {
typescriptCompiler = ts.createProject('tsconfig.json', {
"typescript": require('typescript')
});
}
return gulp.src(project.transpiler.dtsSource.concat(project.transpiler.source))
.pipe(plumber({errorHandler: notify.onError('Error: <%= error.message %>')}))
.pipe(changedInPlace({firstPass:true}))
.pipe(sourcemaps.init())
.pipe(ts(typescriptCompiler))
.pipe(build.bundle());
}
示例8: buildTypeScript
function buildTypeScript() {
typescriptCompiler = ts.createProject('tsconfig.json', {
typescript: require('typescript')
});
let dts = gulp.src(project.transpiler.dtsSource);
let src = gulp.src(project.transpiler.source)
.pipe(changedInPlace({firstPass: true}));
return eventStream.merge(dts, src)
.pipe(plumber({ errorHandler: notify.onError('Error: <%= error.message %>') }))
.pipe(sourcemaps.init())
.pipe(typescriptCompiler())
.pipe(sourcemaps.write({ sourceRoot: 'src' }))
.pipe(build.bundle());
}