scalableminds / amd-optimize

An AMD (RequireJS) optimizer that's stream-friendly. Made for gulp.
MIT License
162 stars 29 forks source link

Performance improvement #62

Open tamtakoe opened 9 years ago

tamtakoe commented 9 years ago

There is no problem if you use amdOptimize to build project. But I use this for styles compiling and livereload with gulp-watch and I watch a nasty delay.

I find style.less/style.sass/style.styl near every .js file (this allows not to download excess styles which are not relevant to the current project)

gulpWatch('project/**/*.styl', function() {
    return amdOptimize.src('/bootstrap', {configFile: configPath})
        .pipe(compileProjectStyles())
        .pipe(gulp.dest('build/project')));

amdOptimize scans scripts every time. Add, please, option cache: true which allows to use old scripts from cache