本文整理汇总了TypeScript中gulp-inline-ng2-template.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了default函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: 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));
});
示例2: Promise
return new Promise((resolve, reject) => {
debug(`processAssets ${src} to ${dest}`);
vfs.src(`${src}/**/*.ts`)
.pipe(inlineNg2Template({
base: `${src}`,
useRelativePaths: true,
styleProcessor: (path, ext, file, cb) => {
debug(`render stylesheet ${path}`);
const render = pickRenderer(path, ext, file);
debug(`postcss with autoprefixer for ${path}`);
const browsers = browserslist(undefined, { path });
render.then((css: string) => postcss([ autoprefixer({ browsers }) ]).process(css))
.then((result) => {
result.warnings().forEach((msg) => {
warn(msg.toString());
});
cb(undefined, result.css);
})
.catch((err) => {
cb(err || new Error(`Cannot inline stylesheet ${path}`));
});
}
}))
.on('error', reject)
.pipe(vfs.dest(`${dest}`))
.on('end', resolve);
});
示例3: merge
gulp.task("build.src", () => {
var tsResult = gulp.src(["./typings/index.d.ts"].concat(source, specFilesNegate), { base: "./src"})
.pipe(inlineNg2Template({ useRelativePaths: true, base: "/src/*"}))
.pipe(sourcemaps.init())
.pipe(ts(tsProdProject));
return merge(
tsResult.js.pipe(sourcemaps.write()).pipe(gulp.dest("./igniteui-js-blocks")),
tsResult.dts.pipe(gulp.dest("./igniteui-js-blocks"))
);
});
示例4: merge
gulp.task("build.src", function () {
var tsResult = gulp.src(["./typings/main.d.ts"].concat(source), { base: "./src" })
.pipe(inlineNg2Template({ useRelativePaths: true, base: '/src/*' }))
.pipe(sourcemaps.init())
.pipe(ts(tsProdProject));
// must output to /zero-blocks for module path resolution
return merge(
tsResult.js.pipe(sourcemaps.write()).pipe(gulp.dest("./zero-blocks")),
tsResult.dts.pipe(gulp.dest("./zero-blocks"))
);
});
示例5: tsProjectFn
gulp.task('test:buildjs', 'Compile typescript test files', () => {
let src = argv.files ? `*${(argv.files || '').replace('*','')}*` : '*';
var tsProject = tsProjectFn();
var result = gulp.src([
'typings/browser.d.ts',
`test/src/**/${src}.ts`
])
.pipe(plumber())
.pipe(sourcemaps.init())
.pipe(inlineNg2Template({base: 'test/src', useRelativePaths: true}))
.pipe(tsc(tsProject));
return result.js
.pipe(printFiles())
.pipe(sourcemaps.write())
.pipe(gulp.dest('test/src'));
});