gulp.task('compile-project', function () {
    var opts = {
        basedir: config.paths.app,
        debug: true
    };
    var streamFinished = function () {
        gutil.log('End stream');
    };
    var entry = config.paths.app + '/main.ts';
    var fileName = path.basename(entry, path.extname(entry)) + ".js";

    var project = ts.createProject('tsconfig_m.json', {
        outFile: fileName
    });

    var tsResult = project.src()
        .pipe(project())
        .pipe(wrap({ src: 'template.txt' }))
        .pipe(gulp.dest(config.paths.pub))
        .pipe(rename({ suffix: '.debug' }))
        .pipe(gulp.dest(config.paths.pub))
        .pipe(uglify())
        .pipe(rename(fileName))
        .pipe(gulp.dest(config.paths.pub))
        .on('end', streamFinished);
});
gulp.task('compile-typescript', function () {
    var streamFinished = function () {
        gutil.log('End stream');
    };
    var entry = config.paths.app + '/main.ts';
    var fileName = path.basename(entry, path.extname(entry)) + ".js";
    return gulp.src(entry)
        .pipe(ts({
            target: "ES5",
            noImplicitAny: false,
            moduleResolution: "node",
            outFile: fileName,
            removeComments: true,
            experimentalDecorators: true
        }))
        .pipe(wrap({ src: 'template.txt' }))
        .pipe(rename({ suffix: '.debug' }))
        .pipe(gulp.dest(config.paths.pub))
        .pipe(uglify())
        .pipe(rename(fileName))
        .pipe(gulp.dest(config.paths.pub))
        .on('end', streamFinished);


    //.pipe(wrap('(function($){\n"use strict";\n<%= contents %>\n})(jQuery);'))
    //.pipe(rename(fileName))

});
Beispiel #3
0
gulp.task("bump", ['clean'], () => {
    return gulp.src('./publish.json')
        .pipe(bump())
        .pipe(gulp.dest('./'))
        .pipe(rename('package.json'))
        .pipe(gulp.dest('dist'));
});
Beispiel #4
0
  return new Promise((resolve) => {
    var doneCount = 0;
    output.js
      .pipe(rename(buildUtils.stripSrcFromPath))
      .pipe(gulp.dest('dist'))
      .on('end', maybeDone),
    output.dts
      .pipe(rename(buildUtils.stripSrcFromPath))
      .pipe(gulp.dest('dist'))
      .on('end', maybeDone)

    function maybeDone() {
      doneCount++;
      if (doneCount == 2) resolve();
    }
  })
Beispiel #5
0
 gulp.task('pcss:build', () => gulp.src(env.path.src.css)
   .pipe(plumber())
   .pipe(postcss(postCssPlugins))
   .pipe(rename({
     extname: '.css',
   }))
   .pipe(gulp.dest(`${env.dir.src}/app`)));
Beispiel #6
0
export = gulp.task('config', () => {
  return gulp
    .src(paths.sources.config)
    .pipe(replace(config.replace(argv.appName, argv.serviceURL)))
    .pipe(rename('config.ts'))
    .pipe(gulp.dest(paths.config));
});
Beispiel #7
0
gulp.task('task:bundles:minify', () => gulp
  .src([
    'tmp/es5/bundles/**/*.js'
  ])
  .pipe(uglify())
  .pipe(rename({suffix: '.min'}))
  .pipe(gulp.dest('tmp/es5/bundles')));
export function getBrowserCodeStream(opts?: PrebootOptions): any {
  opts = normalize(opts);

  let bOpts = {
    entries: [__dirname + '/../browser/preboot_browser.js'],
    standalone: 'preboot',
    basedir: __dirname + '/../browser',
    browserField: false
  };
  let b = browserify(bOpts);

  // ignore any strategies that are not being used
  ignoreUnusedStrategies(b, bOpts, opts.listen, listenStrategies, './listen/listen_by_');
  ignoreUnusedStrategies(b, bOpts, opts.replay, replayStrategies, './replay/replay_after_');

  if (opts.freeze) {
    ignoreUnusedStrategies(b, bOpts, [opts.freeze], freezeStrategies, './freeze/freeze_with_');
  }

  // ignore other code not being used
  if (!opts.buffer) { b.ignore('./buffer_manager.js', bOpts); }
  if (!opts.debug) { b.ignore('./log.js', bOpts); }

  // use gulp to get the stream with the custom preboot browser code
  let outputStream = b.bundle()
    .pipe(source('src/browser/preboot_browser.js'))
    .pipe(buffer())
    .pipe(insert.append('\n\n;preboot.init(' + stringifyWithFunctions(opts) + ');\n\n'))
    .pipe(rename('preboot.js'));

  // uglify if the option is passed in
  return opts.uglify ? outputStream.pipe(uglify()) : outputStream;
}
Beispiel #9
0
gulp.task('task:worker:minify', () => gulp
  .src([
    'dist/worker.js'
  ], {base: 'dist'})
  .pipe(uglify())
  .pipe(rename({suffix: '.min'}))
  .pipe(gulp.dest('dist')));
Beispiel #10
0
 gulp.task("build:jsx", function () {
     return gulp.src(options.filePattern)
         .pipe(transform(options.transformOptions))
         .pipe(rename({
             extname: ".js"
         }))
         .pipe(gulp.dest(options.dest));
 });