Last active
April 9, 2017 07:10
-
-
Save Mefistophell/bfc87da512f8853673b653fef2676a4a to your computer and use it in GitHub Desktop.
Gupl config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var uglify = require('gulp-uglify'); | |
var streamify = require('gulp-streamify'); | |
var browserify = require('browserify'); | |
var babelify = require('babelify'); | |
var source = require('vinyl-source-stream'); | |
gulp.task('build', function () { | |
return browserify({entries: 'components/app.jsx', extensions: ['.jsx'], debug: true}) | |
.transform('babelify', {presets: ['es2015', 'react']}) | |
.bundle() | |
.pipe(source('bundle.js')) | |
.pipe(streamify(uglify())) | |
.pipe(gulp.dest('assets')); | |
}); | |
gulp.task('watch', ['build'], function () { | |
gulp.watch('components/*.jsx', ['build']); | |
}); | |
gulp.task('default', ['watch']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var uglify = require('gulp-uglify'); | |
var streamify = require('gulp-streamify'); | |
var browserify = require('browserify'); | |
var babelify = require('babelify'); | |
var source = require('vinyl-source-stream'); | |
gulp.task('build', function () { | |
return browserify({entries: 'components/main/app.jsx', extensions: ['.jsx'], debug: true}) | |
.transform('babelify', {presets: ['es2015', 'react', 'stage-1'], plugins: ["transform-decorators-legacy"]}) | |
.bundle() | |
.pipe(source('bundle.js')) | |
.pipe(streamify(uglify())) | |
.pipe(gulp.dest('assets/js')); | |
}); | |
gulp.task('watch', ['build'], function () { | |
gulp.watch('components/main/*.jsx', ['build']); | |
}); | |
gulp.task('default', ['watch']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var uglify = require('gulp-uglify'); | |
var streamify = require('gulp-streamify'); | |
var browserify = require('browserify'); | |
var babelify = require('babelify'); | |
var source = require('vinyl-source-stream'); | |
var sourcemaps = require('gulp-sourcemaps'); | |
var buffer = require('vinyl-buffer'); | |
gulp.task('build', function () { | |
return browserify({entries: 'components/app.jsx', extensions: ['.jsx'], debug: true}) | |
.transform('babelify', {presets: ['es2015', 'react', 'stage-1'], plugins: ["syntax-async-functions", "transform-decorators-legacy"]}) | |
.bundle() | |
.pipe(source('bundle.js')) | |
.pipe(buffer()) | |
.pipe(sourcemaps.init({loadMaps: true})) | |
.pipe(streamify(uglify())) | |
.pipe(sourcemaps.write('./')) | |
.pipe(gulp.dest('assets/js')); | |
}); | |
gulp.task('watch', ['build'], function () { | |
gulp.watch(['components/main/*.jsx', 'components/*.jsx', 'models/model.js', 'client/client.js'], ['build']); | |
}); | |
gulp.task('default', ['watch']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'), | |
uglify = require('gulp-uglify'), | |
concat = require('gulp-concat'), | |
babel = require('gulp-babel'), | |
imagemin = require('gulp-imagemin'), | |
livereload = require('gulp-livereload'), | |
csso = require('gulp-csso'); | |
gulp.task('js', function () { | |
gulp.src(['./js/json5.js', './js/common.js', './js/consumption.js', './js/visual.js', './js/script.js', './js/corrects.js']) | |
.pipe(babel({ | |
presets: ['es2015'] | |
})) | |
.pipe(concat('index.js')) | |
.pipe(uglify()) | |
.pipe(gulp.dest('./build/js')) | |
.pipe(livereload()); | |
}); | |
gulp.task('css', function () { | |
return gulp.src('./css/*.css') | |
.pipe(concat('style.css')) | |
.pipe(csso()) | |
.pipe(gulp.dest('./build/css')); | |
}); | |
gulp.task('images', function () { | |
gulp.src('./image/*') | |
.pipe(imagemin()) | |
.pipe(gulp.dest('./build/image')) | |
}); | |
gulp.task('watch', function () { | |
livereload.listen(); | |
gulp.watch('./js/*', ['js']); | |
gulp.watch('./css/*', ['css']); | |
gulp.watch('./image/*', ['images']); | |
}); | |
gulp.task('build', ['css', 'js']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "gulp-react", | |
"version": "1.0.0", | |
"description": "gulp and react", | |
"main": "index.js", | |
"scripts": { | |
"start": "node index.js", | |
"build": "browserify -t [ reactify ] app.js -o public/bundle.js", | |
"env": "SET DEBUG=web:* & npm start" | |
}, | |
"author": "Nill", | |
"license": "ISC", | |
"dependencies": { | |
"babel-plugin-transform-decorators-legacy": "^1.3.4", | |
"babel-preset-es2015": "^6.24.0", | |
"babel-preset-react": "^6.23.0", | |
"babel-preset-stage-1": "^6.22.0", | |
"babelify": "^7.3.0", | |
"browserify": "^14.1.0", | |
"express": "^4.15.2", | |
"gulp": "^3.9.1", | |
"gulp-streamify": "^1.0.2", | |
"gulp-uglify": "^2.1.2", | |
"mobx": "^3.1.8", | |
"mobx-react": "^4.1.5", | |
"multiparty": "^4.1.3", | |
"pug": "^2.0.0-beta11", | |
"react": "^15.4.2", | |
"react-bootstrap": "^0.30.8", | |
"react-dom": "^15.4.2", | |
"vinyl-source-stream": "^1.1.0" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "gulp-react", | |
"version": "1.0.0", | |
"description": "gulp and react", | |
"main": "index.js", | |
"scripts": { | |
"start": "node index.js", | |
"build": "browserify -t [ reactify ] app.js -o public/bundle.js", | |
"env": "SET DEBUG=web:* & npm start" | |
}, | |
"author": "Nill", | |
"license": "ISC", | |
"dependencies": { | |
"babel-preset-es2015": "^6.24.0", | |
"babel-preset-react": "^6.23.0", | |
"babelify": "^7.3.0", | |
"browserify": "^14.1.0", | |
"express": "^4.15.2", | |
"gulp": "^3.9.1", | |
"gulp-streamify": "^1.0.2", | |
"gulp-uglify": "^2.1.2", | |
"multiparty": "^4.1.3", | |
"pug": "^2.0.0-beta11", | |
"react": "^15.4.2", | |
"react-bootstrap": "^0.30.8", | |
"react-dom": "^15.4.2", | |
"vinyl-source-stream": "^1.1.0" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "slivkimedia", | |
"version": "1.0.0", | |
"description": "test", | |
"main": "gulpfile.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "Saturn", | |
"license": "ISC", | |
"devDependencies": { | |
"babel-preset-es2015": "^6.24.1", | |
"gulp": "^3.9.1", | |
"gulp-babel": "^6.1.2", | |
"gulp-concat": "^2.6.1", | |
"gulp-csso": "^3.0.0", | |
"gulp-imagemin": "^3.2.0", | |
"gulp-livereload": "^3.8.1", | |
"gulp-uglify": "^2.1.2" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment