當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript browser-sync.default方法代碼示例

本文整理匯總了TypeScript中browser-sync.default方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript browser-sync.default方法的具體用法?TypeScript browser-sync.default怎麽用?TypeScript browser-sync.default使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在browser-sync的用法示例。


在下文中一共展示了browser-sync.default方法的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.default方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。