Ejemplo n.º 1
0
function bundle() {
  return rollup({
    entry: ['./test/setup/browser.js', './test/unit/**/*.js'],
    plugins: [
      multiEntry(),
      nodeResolve({ main: true }),
      commonjs(),
      nodeGlobals(),
      json(),
      babel({
        sourceMaps: true,
        presets: [ preset ],
        babelrc: false,
        exclude: 'node_modules/**'
      })
    ]
  }).then(function (bundle) {
    return bundle.write({
      format: 'iife',
      sourceMap: true,
      moduleName: 'MnTests',
      dest: './tmp/__spec-build.js'
    });
  }).then(livereload.changed('./tmp/__spec-build.js'));
}
Ejemplo n.º 2
0
gulp.task("watch", function (file) {
    livereload.listen();
    livereload.changed(file.path);
    gulp.watch('*.es6', ['compileEs6']);
	gulp.watch('*.less', ['lessc']);
    gulp.watch('*.css', ['cssminify']);
});
Ejemplo n.º 3
0
	webpack(webpackConfig, function (err, stats) {
		if (err) { throw new gutil.PluginError('webpack', err) }
		var statsAsString = stats.toString({})

		gutil.log('[webpack]', statsAsString )
		livereload.changed('public/js/main.js')
		callback()
	})
Ejemplo n.º 4
0
 devCompiler.run(function (err, stats) {
   if (err) throw new gutil.pluginError('webpack:build-dev', err) //eslint-disable-line
   gutil.log('[webpack:build-dev]', stats.toString({
     colors: true
   }))
   livereload.changed(outputFile)
   callback()
 })
Ejemplo n.º 5
0
 }).on('change', function(changed) {
   if (changed.match(/\.(js|map)/)) {
     // full page reload
     livereload.changedSoon(changed);
   } else {
     livereload.changed(changed);
   }
 });
Ejemplo n.º 6
0
    serverChildProc.on('message', function (message) {
      if ('listening' === message.event) {
        gLiveReload.changed();
        next();
      }

      if ('error' === message.event)  {
        gutil.log(gutil.colors.red('Error on start server:', message.details));
      }
    });
Ejemplo n.º 7
0
 .on('start', function() {
   if (started) {
     gutil.log('...nodemon start, reloading lr');
     livereload.changed('*', opts.lr);
   } else {
     gutil.log('...nodemon start');
     started = true;
     setTimeout(function() {
         open('http://' + opts.frontend.hostname + ':' + opts.frontend.port);
       }, 500);
   }
 });
Ejemplo n.º 8
0
    }, function(err, stats) {
        if (err) throw new gutil.PluginError("webpack", err);

        // Log stadisticas
        gutil.log("[webpack]", stats.toString({
            // output options
        }));

        // Reload navegador
        livereload.changed('public/js/main.js');

        callback();
    });
Ejemplo n.º 9
0
	function afterBuild(err) {
		lastChanged = null;

		if (err) {
			Util.log.info(colors.red(logSymbols.error + ' Build failed!'));
			Util.log.derror(err);
			watcherInstance.emit('error', err);
		} else {
			Util.log.info(colors.green('Build completed.'));
			livereload.changed();
			watcherInstance.emit('change');
		}
	}
Ejemplo n.º 10
0
  gulp.watch(paths.dist.templates + '*.html', function(file) {
    var filename = file.path.split("/").pop();

    livereload.changed(filename);

    if (notifications.enabled) {
      gulp.src('.').pipe(notify({
        sound: notifications.mute ? false : notifications.sound,
        icon: './node_modules/gulp-notify/assets/gulp.png',
        message: filename + ' reloaded',
      }));
    }
  });
Ejemplo n.º 11
0
	gulp.watch('src/**/*', function(event) {
		var filePath = event.path
		if (/\.js$/.test(filePath)) {
			gulp.src(filePath, {
				base : SRC
			}).pipe(babel({
				blacklist : 'useStrict'
			})).pipe(gulp.dest(DEST))
		} else {
			gulp.src(filePath, {
				base : SRC
			}).pipe(gulp.dest(DEST))
		}
		livereload.changed(path.join(__dirname, filePath))
	})
Ejemplo n.º 12
0
gulp.task('watch', function() {
  var watch = function(path, task) {
    gulp.watch(path, function(events) {
      console.log(events.path + ' changed. running task ' + task + '.');
      runSequence(task, function() {
        livereload.changed(events.path);
      })
    }).on('change', function(file) {
    });
  };

  livereload.listen();
  livereload.changed();

  watch('./app/index.html', 'move:html');
  watch('./app/**/*.js', 'build:app');
  watch('./app/app.scss', 'move:css');
  watch('./app/assets/**/*', 'move:assets');
  watch('./app/components/**/*', 'move:components');
});
Ejemplo n.º 13
0
	watch('assets/src/**/*.scss', function () {
		gulp.start('dist-sass');
    gulp.start('version-update');
		livereload.changed();
	});
Ejemplo n.º 14
0
	gulp.watch(['style.css', '*.php', js, 'parts/**/*.php'], function (files){
		livereload.changed(files);
	});
Ejemplo n.º 15
0
 setTimeout(function () {
   livereload.changed('Restart Client');
 }, 1000);
 ]).on('change', function (file) {
   livereload.changed(file.path);
 });
Ejemplo n.º 17
0
 setTimeout(function () {
   livereload.changed();
 }, 500);
Ejemplo n.º 18
0
 server.changed( function( error ) {
   if( ! error ) livereload.changed( file.path );
 });
Ejemplo n.º 19
0
 ]).on('change', function(file){
   //console.log(file.path + ' changed')
   livereload.changed(file)
 });
 setTimeout(function () {
   livereload.changed(__dirname);
 }, 500);
Ejemplo n.º 21
0
 }).on('restart', function(){
     livereload.changed('server.coffee');
 });
Ejemplo n.º 22
0
 gulp.watch(BUILD+env+'/assets/**').on('change', function(file) {
   console.log(file.path);
   livereload.changed(file.path);
 }).on('error', gutil.log);
Ejemplo n.º 23
0
 setTimeout((function () { livereload.changed(file); }), 3000);
Ejemplo n.º 24
0
 server.start().then(function(){
   console.error('Server Reloaded.');
   livereload.changed( args.path );
 });
Ejemplo n.º 25
0
 .pipe(gulp.dest(getOutputDir())).on('end', function() {
   if (watching) livereload.changed('');
 });
Ejemplo n.º 26
0
 watch(source + pattern, (event) => {
   livereload.changed(event.path)
   performCopy()
 })
Ejemplo n.º 27
0
 this.stdout.on('data', function (chunk) {
   if(/^Express server listening on port/.test(chunk)){
     livereload.changed(__dirname);
   }
 });
Ejemplo n.º 28
0
 watch(pattern, async (event) => {
   const stream = buildScss()
   await endOfStream(stream)
   livereload.changed(event.path)
 })
 ], function(evt) {
     livereload.changed(evt.path);
 });
Ejemplo n.º 30
0
 bundler.on('update', async (ids) => {
   const stream = performBundle()
   await endOfStream(stream)
   livereload.changed(`${ids}`)
 })