javascript - Gulp is reverting all my changes? -
i forked repository: https://github.com/angular-ui/ui-select , made changes here: https://github.com/zhen-w/ui-select. issue is, made changes source code of angular-ui/ui-select
when run command gulp
try generate minified versions of files, changes seem reverted , minified files generated not new changes want. here contents of gulpfile.js
:
var fs = require('fs'); var gulp = require('gulp'); var karma = require('karma').server; var concat = require('gulp-concat'); var jshint = require('gulp-jshint'); var header = require('gulp-header'); var footer = require('gulp-footer'); var rename = require('gulp-rename'); var es = require('event-stream'); var del = require('del'); var uglify = require('gulp-uglify'); var minifyhtml = require('gulp-minify-html'); var minifycss = require('gulp-minify-css'); var templatecache = require('gulp-angular-templatecache'); var gutil = require('gulp-util'); var plumber = require('gulp-plumber');//to prevent pipe breaking caused errors @ 'watch' var config = { pkg : json.parse(fs.readfilesync('./package.json')), banner: '/*!\n' + ' * <%= pkg.name %>\n' + ' * <%= pkg.homepage %>\n' + ' * version: <%= pkg.version %> - <%= timestamp %>\n' + ' * license: <%= pkg.license %>\n' + ' */\n\n\n' }; gulp.task('default', ['build','test']); gulp.task('build', ['scripts', 'styles']); gulp.task('test', ['build', 'karma']); gulp.task('watch', ['build','karma-watch'], function() { gulp.watch(['src/**/*.{js,html}'], ['build']); }); gulp.task('clean', function(cb) { del(['dist'], cb); }); gulp.task('scripts', ['clean'], function() { var buildtemplates = function () { return gulp.src('src/**/*.html') .pipe(minifyhtml({ empty: true, spare: true, quotes: true })) .pipe(templatecache({module: 'ui.select'})); }; var buildlib = function(){ return gulp.src(['src/common.js','src/*.js']) .pipe(plumber({ errorhandler: handleerror })) .pipe(concat('select_without_templates.js')) .pipe(header('(function () { \n"use strict";\n')) .pipe(footer('\n}());')) .pipe(jshint()) .pipe(jshint.reporter('jshint-stylish')) .pipe(jshint.reporter('fail')); }; return es.merge(buildlib(), buildtemplates()) .pipe(plumber({ errorhandler: handleerror })) .pipe(concat('select.js')) .pipe(header(config.banner, { timestamp: (new date()).toisostring(), pkg: config.pkg })) .pipe(gulp.dest('dist')) .pipe(uglify({preservecomments: 'some'})) .pipe(rename({ext:'.min.js'})) .pipe(gulp.dest('dist')); }); gulp.task('styles', ['clean'], function() { return gulp.src('src/common.css') .pipe(header(config.banner, { timestamp: (new date()).toisostring(), pkg: config.pkg })) .pipe(rename('select.css')) .pipe(gulp.dest('dist')) .pipe(minifycss()) .pipe(rename({ext:'.min.css'})) .pipe(gulp.dest('dist')); }); gulp.task('karma', ['build'], function() { karma.start({configfile : __dirname +'/karma.conf.js', singlerun: true}); }); gulp.task('karma-watch', ['build'], function() { karma.start({configfile : __dirname +'/karma.conf.js', singlerun: false}); }); var handleerror = function (err) { console.log(err.tostring()); this.emit('end'); };
i don't see why changes reverted because own forked repository. appreciated. thanks!
everything in dist
directory created gulp - not minified files. if want make changes, edit appropriate file under src
directory.
Comments
Post a Comment