本文整理匯總了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'));
});