当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript gulp-watch.default方法代码示例

本文整理汇总了TypeScript中gulp-watch.default方法的典型用法代码示例。如果您正苦于以下问题:TypeScript gulp-watch.default方法的具体用法?TypeScript gulp-watch.default怎么用?TypeScript gulp-watch.default使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gulp-watch的用法示例。


在下文中一共展示了gulp-watch.default方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: function

export default async function (env: string, target: string) {
  watch([
    `./src/${target}/**/*.html`,
    '!./src/index.html'
  ], async function(event) {
    minHtml(target).on('end', () => {
      gutil.log(gutil.colors.green('minHtml complete'))
    })
  })

  watch(['./.tmp/scripts/**/*.js'], async function (event) {
    await concatApp(env, target)
    gutil.log(gutil.colors.blue('concat complete'))
  })

  watch([
    './src/less/*.less',
    './src/components/**/*.less',
    `src/${target}/**/*less`
  ], (event) => {
    less(target)
  })

  watch('./src/components/et/**/*.html', async function (event) {
    await et()
    gutil.log(gutil.colors.cyan('et compile complete'))
  })

  watch('./src/**/*.ts', (event) => {
    lint()
  })
  .on('error', function (error) {
    gutil.log(error)
    this.emit('end')
  })

  return await webpack(env, target, true, async function (resolve) {
    gutil.log(gutil.colors.yellow('webpack complete'))
    await concatApp(env, target)
    gutil.log(gutil.colors.cyan('concat app complete'))
    resolve()
  })

}
开发者ID:jianxc,项目名称:teambition-mobile-web,代码行数:44,代码来源:watch.ts

示例2: e2eWatch

function e2eWatch(componentName: string, componentTest: string) {
  // If any tests change within components then run e2e.resources.
  watch([
    'src/components/*/test/**/*'
  ],
    function (file) {
      console.log('start e2e.resources - ' + JSON.stringify(file.history, null, 2));
      start('e2e.copyAndCompile');
    });

  // If any src files change except for tests then transpile only the source ionic files
  watch([
    'src/**/*.ts',
    '!src/components/*/test/**/*',
    '!src/util/test/*'
  ],
    function (file) {
      console.log('start e2e.ngcSource - ' + JSON.stringify(file.history, null, 2));
      start('e2e.copyAndCompile');
    });

  // If any scss files change then recompile all sass
  watch(['src/**/*.scss'], (file) => {
    console.log('start sass - ' + JSON.stringify(file.history, null, 2));
    start('e2e.sass');
  });

  console.log(`http://localhost:${LOCAL_SERVER_PORT}/${DIST_NAME}/${E2E_NAME}/components/${componentName}/test/${componentTest}/`);

  start('e2e.serve');
}
开发者ID:JackMj,项目名称:ionic,代码行数:31,代码来源:e2e.prod.ts

示例3: e2eWatch

function e2eWatch(componentName: string, componentTest: string) {
  const webpack = require('webpack');
  const WebpackDevServer = require('webpack-dev-server');
  const config = require('../../e2e/webpack.config.js');

  config.output.path = join(__dirname, '../../../');
  config.entry = {
    'dist/e2e/vendor': './scripts/e2e/vendor',
    'dist-e2e/polyfills': './scripts/e2e/polyfills'
  };
  config.entry[`./dist/e2e/components/${componentName}/test/${componentTest}/index`] = `./dist/e2e/components/${componentName}/test/${componentTest}/entry`;

  const compiler = webpack(config);

  // If any tests change within components then run e2e.resources.
  watch([
    'src/components/*/test/**/*'
  ],
  function(file) {
    console.log('start e2e.resources - ' + JSON.stringify(file.history, null, 2));
    start('e2e.copyAndCompile');
  });

  // If any src files change except for tests then transpile only the source ionic files
  watch([
    'src/**/*.ts',
    '!src/components/*/test/**/*',
    '!src/util/test/*'
  ],
  function(file) {
    console.log('start e2e.ngcSource - ' + JSON.stringify(file.history, null, 2));
    start('e2e.copyAndCompile');
  });

  // If any scss files change then recompile all sass
  watch(['src/**/*.scss'], (file) => {
    console.log('start sass - ' + JSON.stringify(file.history, null, 2));
    start('e2e.sass');
  });

  new WebpackDevServer(compiler, {
    noInfo: true,
    quiet: false,
    watchOptions: {
      aggregateTimeout: 2000,
      poll: 1000
    }
  }).listen(LOCAL_SERVER_PORT, 'localhost', function(err) {
    if (err) {
      throw err;
    }
    console.log(`http://localhost:${LOCAL_SERVER_PORT}/${DIST_NAME}/${E2E_NAME}/components/${componentName}/test/${componentTest}/`);
  });
}
开发者ID:dioxmio,项目名称:ionic,代码行数:54,代码来源:e2e.ts

示例4: function

task('e2e.watch', ['e2e'], function () {
  watchTask('e2e.bundle');

  watch('src/components/*/test/**/*', function (file) {
    start('e2e.build');
  });
});
开发者ID:fsdn,项目名称:ionic,代码行数:7,代码来源:e2e.dev.ts

示例5: gulpWatch

let watchPath = (p) => {
  gulpWatch(
    p,
    {
      read: false, // performance optimization: do not read actual file contents
      verbose: true
    },
    (vinyl) => processChange(vinyl));
};
开发者ID:Resounding,项目名称:Jobs-Web,代码行数:9,代码来源:watch.ts

示例6:

gulp.task('build', () => {
    var files = [
        'app/**/*.ts',
        'lib/**/*.ts',
        'components/**/*.ts',
    ];

    gulp.src(files, { base: '..' })
        .pipe(watch(files, { base: '..' }));
});
开发者ID:0815fox,项目名称:DefinitelyTyped,代码行数:10,代码来源:gulp-watch-tests.ts

示例7: watchTask

function watchTask(task) {
  watch([
    'src/**/*.ts',
    '!src/components/*/test/**/*',
    '!src/util/test/*'
  ],
    function (file) {
      if (file.event !== 'unlink') {
        start(task);
      }
    }
  );

  watch('src/**/*.scss', function () {
    start('e2e.sass');
  });

  start('e2e.serve');
}
开发者ID:fsdn,项目名称:ionic,代码行数:19,代码来源:e2e.dev.ts

示例8: demosWatch

function demosWatch(componentName: string, componentTest: string) {
  // If any tests change within components then run demos.resources.
  watch([
    'demos/src/**/*'
  ],
    function (file) {
      console.log('start demos.resources - ' + JSON.stringify(file.history, null, 2));
      start('demos.copyAndCompile');
    });

  // If any src files change except for tests then transpile only the source ionic files
  watch([
    'src/**/*.ts',
    '!src/components/*/test/**/*',
    '!src/util/test/*'
  ],
    function (file) {
      console.log('start demos.ngcSource - ' + JSON.stringify(file.history, null, 2));
      start('demos.copyAndCompile');
    });

  // If any scss files change then recompile all sass
  watch(['src/**/*.scss'], (file) => {
    console.log('start sass - ' + JSON.stringify(file.history, null, 2));
    start('demos.sass');
  });

  let serverUrl = `http://localhost:${LOCAL_SERVER_PORT}/${DIST_NAME}/${DEMOS_NAME}`;
  if (componentName) {
    serverUrl += `/${componentName}`;
  }

  console.log(serverUrl);

  start('demos.serve');
}
开发者ID:BossKing,项目名称:ionic,代码行数:36,代码来源:demos.prod.ts

示例9: gulpWatch

let watch = (callback?) => {
  watchCallback = callback || watchCallback;
  return gulpWatch(
    Object.keys(watches),
    {
      read: false, // performance optimization: do not read actual file contents
      verbose: true
    },
    (vinyl) => {
      if (vinyl.path && vinyl.cwd && vinyl.path.startsWith(vinyl.cwd)) {
        let pathToAdd = vinyl.path.substr(vinyl.cwd.length + 1);
        log(`Watcher: Adding path ${pathToAdd} to pending build changes...`);
        pendingRefreshPaths.push(pathToAdd);
        refresh();
      }
    });
};
开发者ID:reyno-uk,项目名称:cli,代码行数:17,代码来源:watch.ts


注:本文中的gulp-watch.default方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。