本文整理匯總了TypeScript中gulp-replace.default函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript default函數的具體用法?TypeScript default怎麽用?TypeScript default使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了default函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: Scaffolding
export default function Scaffolding() {
let name = helper.getCurrentTarget();
if (!name) {
return Promise.reject(new Error("Missing required project name"));
}
let projectPath = path.resolve(__dirname, "../../scaffolding", helper.getProjectType());
return gulp.src(projectPath + '/**/*')
.pipe(replace("$$NAME", name))
.pipe(gulp.dest(`./${name}`));
}
示例2: html2js
() => {
var filename = debuggerIndexFile,
filePath = path.resolve(__dirname, filename),
source = fs.readFileSync(filePath, 'utf8');
var tpl = html2js(source, {
mode: 'default',
wrap: false
});
return gulp.src(SOURCE_DIR + '/' + DEBUGGER_NAMESPACE + '/debug.js')
.pipe(template({
template: tpl
}))
.pipe(gulpif(minify, uglify()))
.pipe(gulpif(env === 'dev', replace(/##host##/g, `${baseUrl}container-debugger`)))
.pipe(gulp.dest(DEST_DIR + '/' + DEBUGGER_NAMESPACE));
}
示例3: packageReplaceReferences
/**
* Removes /// <reference from compiled sources.
*/
@Task()
packageReplaceReferences() {
return gulp.src("./build/package/**/*.d.ts")
.pipe(replace(`/// <reference types="node" />`, ""))
.pipe(replace(`/// <reference types="chai" />`, ""))
.pipe(gulp.dest("./build/package"));
}
示例4:
gulp.task('task:commonjs:rewrite_plugins', () => gulp
.src([
'tmp/es5/src/plugins/**/*.js'
])
.pipe(replace(/'@angular\/service-worker\/worker'/, "'../../worker'"))
.pipe(replace(/"@angular\/service-worker\/worker"/g, "'../../worker'"))
.pipe(gulp.dest('tmp/es5/src/plugins')));
示例5: bundleRenameDev
function bundleRenameDev() {
src([
`${LIB_DIR}/**/*.*`,
], { base: './' })
.pipe(replace('@nebular', '@nebular-dev'))
.pipe(dest('./'));
}
示例6: Promise
return new Promise((resolve, reject) => {
gulp
.src('compiled/ngc/modules/**/*')
.pipe(rename(buildUtils.stripSrcFromPath))
.pipe(replace(/\.\/src\//g, './'))
.pipe(gulp.dest('dist'))
.on('error', reject)
.on('end', resolve);
});
示例7: Promise
return new Promise((resolve) => {
var doneCount = 0;
output.js
.pipe(rename(buildUtils.stripSrcFromPath))
.pipe(replace(/\.\/src\//g, './'))
.pipe(gulp.dest('dist'))
.on('end', maybeDone),
output.dts
.pipe(rename(buildUtils.stripSrcFromPath))
.pipe(replace(/\.\/src\//g, './'))
.pipe(gulp.dest('dist'))
.on('end', maybeDone);
function maybeDone() {
doneCount++;
if (doneCount === 2) {
resolve();
}
}
});
示例8: join
export = () => {
return gulp.src([
join(Config.APP_SRC, '**/*.ts'),
join(Config.APP_SRC, '**/*.json'),
'!' + join(Config.APP_SRC, '**/*.spec.ts'),
'!' + join(Config.APP_SRC, '**/*.e2e-spec.ts')
])
// import in dev mode: import * as moment from 'moment';
// import for rollup: import moment from 'moment';
.pipe(replace('import * as moment from \'moment\';', 'import moment from \'moment\';'))
// .pipe(replace('import * as uuid from \'node-uuid\';', 'import uuid from \'node-uuid\';'))
.pipe(gulp.dest(Config.TMP_DIR));
};
示例9:
() => {
return gulp.src([
DEST_DIR + '/' + DEBUGGER_NAMESPACE + '/index.test.html',
DEST_DIR + '/' + DEBUGGER_NAMESPACE + '/index.test.referrer.html'
])
.pipe(ejs({
getLocale: i18n.getLocale,
version: versionJson.version,
__: i18n.__
}))
.pipe(replace(/##host##/g, baseUrl + '/' + DEBUGGER_NAMESPACE))
.pipe(gulp.dest(DEST_DIR + '/' + DEBUGGER_NAMESPACE));
}
示例10: packageReadmeFile
/**
* This task will replace all typescript code blocks in the README (since npm does not support typescript syntax
* highlighting) and copy this README file into the package folder.
*/
@Task()
packageReadmeFile() {
return gulp.src("./README.md")
.pipe(replace(/```typescript([\s\S]*?)```/g, "```javascript$1```"))
.pipe(gulp.dest("./build/package"));
}