本文整理汇总了TypeScript中gulp-nodemon类的典型用法代码示例。如果您正苦于以下问题:TypeScript gulp-nodemon类的具体用法?TypeScript gulp-nodemon怎么用?TypeScript gulp-nodemon使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了gulp-nodemon类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: watch
@Task()
watch() {
gulp.watch('src/**/*.ts', this.buildTypescript);
nodemon({
script: './dist/src/server.js'
});
}
示例2: nodemon
gulp.task('server.w', (done) =>
nodemon({
script: 'server/boot.ts',
watch: 'server',
ext: 'ts',
env: { 'APP_ENVIRONMENT': process.env.APP_ENVIRONMENT },
execMap: {
ts: 'node node_modules/ts-node/dist/bin/ts-node.js'
}
}).on('start', () => {
console.log('Server started');
}).once('start', () => {
const tinylrObj = tinylr();
tinylrObj.listen(LIVE_RELOAD_PORT);
const intervalId = setInterval(() => {
const existsDist = fse.existsSync(PATHS.dest.dist.appBundle);
if (existsDist) {
clearInterval(intervalId);
setTimeout(() => {
openResource(`http://localhost:${PORT}`);
done();
}, 3000);
}
}, 500);
})
示例3: nodemon
gulp.task('server.start', (done) => {
nodemon({
script: 'server/index.js',
watch: ['server'],
ignore: ['node_modules/**'],
ext: 'js html',
env: { 'NODE_ENV': 'development' }
})
.on('start', () => {
console.log('Server started');
})
.once('start', () => {
const tinylrObj = tinylr();
tinylrObj.listen(LIVE_RELOAD_PORT);
const intervalId = setInterval(() => {
const existsDist = fse.existsSync(PATHS.dest.dist.appBundle);
if (existsDist) {
clearInterval(intervalId);
setTimeout(() => {
openResource(`http://localhost:${PORT}`);
done();
}, 1000);
}
}, 500);
})
});
示例4: nodemon
gulp.task('nodemon', ['script'], () => {
nodemon({
script: 'dist/server/app.js',
ext: 'js',
env: { 'NODE_ENV': 'development' }
});
});
示例5: run
static run(config: any, tinylr: any) {
nodemon({
script: "server/boot.ts",
watch: ["server"],
ext: "ts",
env: { profile: process.env.profile },
execMap: { ts: "ts-node" }
});
tinylr.listen(config.liveReloadPort);
}
示例6: nodemon
gulp.task('server.watch', () => {
nodemon({
script: 'server/bootstrap.ts',
watch: 'server',
ext: 'ts',
env: { 'profile': process.env.profile },
execMap: {
ts: 'ts-node'
}
}).on('restart', () => {
process.env.RESTART = true;
});
});
示例7: runAndWatch
export function runAndWatch({
script,
production,
watch
}) {
nodemon({
script,
ext: 'js',
delay: 200,
watch: watch ? (Array.isArray(watch) ? watch : [watch]) : [dirname(script)],
execMap: {
js: `node --debug=${5858}`
},
env: {
NODE_ENV: production ? 'production' : 'development'
}
});
}
示例8: nodemon
export = () => {
nodemon({
script: 'dist/dev/server/server.js',
watch: ['dist/dev/server']
});
};