Giter Site home page Giter Site logo

Comments (4)

ahaurw01 avatar ahaurw01 commented on September 26, 2024

@xlc I have not used that plugin before. Can you describe the problems you're having and what you've tried?

from gulp-remember.

xlc avatar xlc commented on September 26, 2024

This is part of my existing gulp task

var $ = require('gulp-load-plugins')();

   return gulp.src('src/**/*.js')
      .pipe($.sourcemaps.init()) // enable source map
      .pipe($.if(!options.debug, $.ngAnnotate())) // process js files
      .pipe($.if(!options.debug, $.uglify()))
      .pipe($.concat('script.js')) // concat all of them into one
      .pipe($.sourcemaps.write('.')) // and produce one sourcemap 
      .pipe(gulp.dest(options.dist));

I don't want to reprocess all js files with ngAnnotate and uglify even only one of them changed.
I will like this

   return gulp.src('src/**/*.js')
      .pipe($.sourcemaps.init()) // enable source map
      .pipe($.cached()) // only pass changed files
      .pipe($.if(!options.debug, $.ngAnnotate())) // process js files
      .pipe($.if(!options.debug, $.uglify()))
      .pipe($.remember()) // get all files
      .pipe($.concat('script.js')) // concat all of them into one
      .pipe($.sourcemaps.write('.')) // and produce one sourcemap 
      .pipe(gulp.dest(options.dist));

But I think this require gulp-cached and gulp-remember support gulp-sourcemaps in order to work.

from gulp-remember.

ahaurw01 avatar ahaurw01 commented on September 26, 2024

I'm sorry, I don't quite follow. What is the problem you're seeing? What about the sourcemap plugin is not working when you use gulp-remember?

from gulp-remember.

sb8244 avatar sb8244 commented on September 26, 2024

I believe that this issue is similar to this:

function getApplicationJSStream() {
  return gulp.src([
      path.join(conf.paths.src, '/javascripts/angular/**/*.js'),
      path.join(conf.paths.tmp, '/templateCacheHtml.js'),
      path.join(conf.paths.src, '/javascripts/angular-app.js')
    ])
    .pipe($.eslint())
    .pipe($.eslint.format())
    .pipe($.sourcemaps.init())
    .pipe($.cached('appJS'))
    .pipe($.uglify())
    .pipe($.remember('appJS'))
    .pipe($.order([
      "**/module.js",
      'templateCacheHtml.js',
      "!angular-app.js",
      "angular-app.js"
    ]))
    .pipe($.concat('application.js'));
}

I use the cached/remember combination around uglify, after sourcemaps has been initialized. It only includes sourcemaps for files that changed and went through the uglifier, but wouldn't have the majority of the sourcemaps.

I do not yet have a solution but am playing around.

from gulp-remember.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.