Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var gulp = require('gulp');
- var webserver = require('gulp-webserver');
- var source = require('vinyl-source-stream');
- var browserify = require('browserify');
- var plugins = require('gulp-load-plugins')();
- //web server立ち上げ
- gulp.task('webserver', function() {
- gulp.src('./')
- .pipe(webserver({
- livereload: true,
- port: 8000,
- fallback: 'index.html',
- open: true
- }));
- });
- //watch
- gulp.task('watch', function() {
- gulp.watch("js/*.js", ["build3"]);
- });
- //uglify + concat
- gulp.task('build', function() {
- gulp.src(['js/app3.js', 'js/app2.js', 'js/app.js'])
- .pipe(plugins.uglify())
- .pipe(plugins.concat('all.min.js'))
- .pipe(gulp.dest('dist/js/'));
- });
- //ngAnotate
- gulp.task('build2', function () {
- return gulp.src('js/app.js')
- .pipe(plugins.ngAnnotate())
- .pipe(gulp.dest('dist'));
- });
- //browserify + debowerify
- gulp.task('build3', function(){
- browserify({
- entries: ['js/app.js'],
- })
- .transform("debowerify", {preferNPM: true})
- .bundle()
- .pipe(source('app.js'))
- .pipe(gulp.dest('dist'));
- });
- gulp.task('default', ['webserver']);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement