本文整理汇总了TypeScript中gulp-plumber类的典型用法代码示例。如果您正苦于以下问题:TypeScript gulp-plumber类的具体用法?TypeScript gulp-plumber怎么用?TypeScript gulp-plumber使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了gulp-plumber类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: 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());
}
示例2: 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()));
}
示例3: compileJs
function compileJs(src: string[], dest: string, inlineTpl?: boolean): NodeJS.ReadWriteStream {
const result = gulp.src(['./tools/typings/tsd/tsd.d.ts', './tools/typings/*.ts'].concat(src))
.pipe(plumber())
.pipe(sourcemaps.init());
return result
.pipe(typescript(tsProject)).js
.pipe(ngAnnotate())
.pipe(sourcemaps.write())
.pipe(gulp.dest(dest));
}
示例4: tslint
/**
* Typescript lint task
*/
@Task('ts::lint')
tslint() {
let lintoptions: any = {
emitError: false,
sort: true,
bell: true
}
return gulp.src(this.config.paths.source)
.pipe(plumber())
.pipe(tslint())
.pipe(tslint.report(require('tslint-stylish'), lintoptions));
}
示例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: merge
/**
* Typescript compile task
*/
@Task('ts::compile')
tscompile(): any {
let sourcepaths = ['typings/main.d.ts'];
sourcepaths.push(this.config.paths.source);
var tsResult = gulp.src(sourcepaths)
.pipe(plumber())
.pipe(ts(this.tsProject));
return merge([
tsResult.dts.pipe(gulp.dest('definitions')),
tsResult.js.pipe(gulp.dest(this.config.paths.dist))
]);
}
示例8: compileTs
function compileTs(src: string | string[], dest: string, inlineTpl?: boolean): NodeJS.ReadWriteStream {
let result = gulp.src(src)
.pipe(plumber())
.pipe(sourcemaps.init());
if (inlineTpl) {
result = result.pipe(inlineNg2Template({ base: PATH.src.base }));
}
return result.pipe(typescript(tsProject))
.js.pipe(sourcemaps.write())
.pipe(gulp.dest(dest));
}
示例9: 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());
}
示例10:
gulp.task("build.css.dev", () => {
gulp.src(["src/themes/*.scss"])
.pipe(plumber())
.pipe(sourcemaps.init())
.pipe(sass({
includePaths: ["src/**/*.scss"],
}))
.pipe(autoprefixer({
browsers: ["last 2 versions"],
cascade: false
}))
.pipe(sourcemaps.write("./"))
.pipe(plumber.stop())
.pipe(gulp.dest("./dist/dev"))
});