diff --git a/app/css/app.css b/app/css/app.css index 1e541bb..4783fe8 100644 --- a/app/css/app.css +++ b/app/css/app.css @@ -29,4 +29,3 @@ padding: 0; } -/* test here */ \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..ea0d63d --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,41 @@ +var gulp = require('gulp'), + plugins = require("gulp-load-plugins")({ + pattern: ['gulp-*', 'gulp.*'], + replaceString: /\bgulp[\-.]/ + }), + del = require('del'); + + +var paths = { + scripts: ['client/js/**/*.coffee', '!client/external/**/*.coffee'], + images: 'client/img/**/*' +}; + + +gulp.task('clean', function(cb) { + del(['build'], cb); +}); + +gulp.task('scripts', ['clean'], function() { + return gulp.src(paths.scripts) + .pipe(plugins.sourcemaps.init()) + .pipe(plugins.uglify()) + .pipe(plugins.concat('all.min.js')) + .pipe(plugins.sourcemaps.write()) + .pipe(gulp.dest('build/js')); +}); + +gulp.task('images', ['clean'], function() { + return gulp.src(paths.images) + .pipe(plugins.imagemin({optimizationLevel: 5})) + .pipe(gulp.dest('build/img')); +}); + + +gulp.task('watch', function() { + gulp.watch(paths.scripts, ['scripts']); + gulp.watch(paths.images, ['images']); +}); + +gulp.task('default', ['watch', 'scripts', 'images']); + diff --git a/package.json b/package.json index 5035daf..ba86489 100644 --- a/package.json +++ b/package.json @@ -6,29 +6,37 @@ "repository": "https://github.com/angular/angular-seed", "license": "MIT", "devDependencies": { + "bower": "^1.3.1", + "del": "^0.1.2", + "gulp": "^3.8.7", + "gulp-concat": "^2.3.4", + "gulp-csslint": "^0.1.5", + "gulp-csso": "^0.2.9", + "gulp-imagemin": "^1.0.1", + "gulp-jshint": "^1.8.4", + "gulp-load-plugins": "^0.6.0", + "gulp-rename": "^1.2.0", + "gulp-sourcemaps": "^1.1.3", + "gulp-uglify": "^0.3.2", + "http-server": "^0.6.1", "karma": "~0.10", + "karma-junit-reporter": "^0.2.2", "protractor": "~0.20.1", - "http-server": "^0.6.1", - "bower": "^1.3.1", - "shelljs": "^0.2.6", - "karma-junit-reporter": "^0.2.2" + "shelljs": "^0.2.6" }, "scripts": { "postinstall": "bower install", - "prestart": "npm install", "start": "http-server -a localhost -p 8000", - "pretest": "npm install", "test": "karma start test/karma.conf.js", "test-single-run": "karma start test/karma.conf.js --single-run", - "preupdate-webdriver": "npm install", "update-webdriver": "webdriver-manager update", - "preprotractor": "npm run update-webdriver", "protractor": "protractor test/protractor-conf.js", - "update-index-async": "node -e \"require('shelljs/global'); sed('-i', /\\/\\/@@NG_LOADER_START@@[\\s\\S]*\\/\\/@@NG_LOADER_END@@/, '//@@NG_LOADER_START@@\\n' + cat('app/bower_components/angular-loader/angular-loader.min.js') + '\\n//@@NG_LOADER_END@@', 'app/index-async.html');\"" } } + +