本文整理汇总了TypeScript中browser-sync类的典型用法代码示例。如果您正苦于以下问题:TypeScript browser-sync类的具体用法?TypeScript browser-sync怎么用?TypeScript browser-sync使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了browser-sync类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: browserSync
let runServer = () => {
let baseDir = APP_DEST;
let routes:any = {
[`${APP_BASE}${APP_DEST}`]: APP_DEST,
[`${APP_BASE}node_modules`]: 'node_modules',
};
if (APP_BASE !== '/') {
routes[`${APP_BASE}`] = APP_DEST;
baseDir = `${DIST_DIR}/empty/`;
}
browserSync({
port: PORT,
startPath: APP_BASE,
server: {
baseDir: baseDir,
middleware: [
proxy({
protocol: 'http:',
hostname: 'localhost',
port: 3000,
pathname: '/api',
route: '/api'
}),
require('connect-history-api-fallback')({index: `${APP_BASE}index.html`})
],
routes: routes
}
});
};
开发者ID:victir,项目名称:todo-angular2-rails-api,代码行数:31,代码来源:code_change_tools.ts
示例2: browserSync
export = () => {
return browserSync({
proxy: "localhost:8080", // local node app address
port: 5000, // use *different* port than above
notify: true
});
}
开发者ID:alexeishirin,项目名称:angular2-seed,代码行数:7,代码来源:my.server.browser.sync.ts
示例3: browserSync
gulp.task('serve', () => {
browserSync({
server: {
baseDir: APP_DEST
}
});
});
开发者ID:jlsuarezs,项目名称:Angular2TS-Starter-Kit,代码行数:7,代码来源:gulpfile.ts
示例4: browserSync
let runServer = () => {
// Angle Start
browserSync({
port: PORT,
proxy: 'localhost',
files: `${APP_DEST}/assets/css/*.css`,
injectChanges: true
});
// Angle End
};
开发者ID:jacerider,项目名称:angle-seed,代码行数:11,代码来源:code_change_tools.ts
示例5: browserSync
let runServer = () => {
let routes:any = {
[`/${APP_DEST}`]: APP_DEST,
'/node_modules': 'node_modules'
};
browserSync({
port: PORT,
startPath: '/',
server: {
baseDir: APP_DEST,
routes: routes
}
});
};
开发者ID:gitter-badger,项目名称:hydra-admin,代码行数:14,代码来源:code_change_tools.ts
示例6: listen
export function listen() {
sync({
'middleware': [require('connect-history-api-fallback')()],
'port': PORT,
'startPath': '/',
'server': {
'baseDir': APP_DEST,
'routes': {
[`/${APP_DEST}`]: APP_DEST,
'/node_modules': 'node_modules'
}
}
});
};
开发者ID:fellswoop,项目名称:angular-project-template,代码行数:14,代码来源:sync.ts
示例7: browserSync
done => {
browserSync({
online: false,
open: false,
port: 9000,
server: {
baseDir: ['.'],
middleware: function(req, res, next) {
res.setHeader('Access-Control-Allow-Origin', '*');
next();
}
}
}, done);
}
开发者ID:itainteasy,项目名称:cli,代码行数:14,代码来源:serve.ts
示例8: browserSync
let runServer = () => {
let routes:any = {
[`/${APP_DEST}`]: APP_DEST,
'/node_modules': 'node_modules'
};
browserSync({
middleware: [require('connect-history-api-fallback')()],
port: PORT,
startPath: '/',
server: {
baseDir: APP_DEST,
routes: routes
}
});
};
开发者ID:Aelphy,项目名称:receipts,代码行数:15,代码来源:code_change_tools.ts
示例9: browserSync
let runServer = () => {
let routes: any = {
[`/${APP_DEST}`]: APP_DEST,
"/node_modules": "node_modules"
};
browserSync({
middleware: [require("connect-history-api-fallback")()],
port: PORT,
startPath: "/",
server: {
baseDir: APP_DEST,
routes: routes
}
});
};
开发者ID:wuyingki,项目名称:angular2-seed,代码行数:15,代码来源:code_change_tools.ts
示例10: browserSync
bundle(true, () => {
if (initBrowserSync) return reload()
initBrowserSync = true
browserSync({
notify: false,
port: 5001,
server: {
baseDir: ['www'],
routes: {
'/node_modules': path.join(process.cwd(), 'node_modules'),
'/www': path.join(process.cwd(), 'www')
}
}
})
})
开发者ID:Saviio,项目名称:angular1.x-injector,代码行数:15,代码来源:serve.ts
注:本文中的browser-sync类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论