Closed gregtatum closed 9 years ago
Can you include the gulp file you're using?
Sure thing. I've only recently started using Gulp so it's quite possible that I'm doing it wrong, but that other issue led me to believe it might not be just me.
var gulp = require('gulp');
var browserify = require('browserify');
var watchify = require('watchify');
var reactify = require('reactify');
var source = require('vinyl-source-stream');
var minifyify = require('minifyify');
var sourcemaps = require('gulp-sourcemaps');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var gutil = require('gulp-util');
var jshint = require('gulp-jshint');
var react = require('gulp-react');
var sass = require('gulp-sass')
var paths = {
entry : './js/main.js',
js : ['js/**/*.js', 'js/**/*.jsx', "gulpfile.js"],
hint : ['assets/build/bundle.js', 'gulpfile.js'],
build : './assets/build/',
bundleName : 'bundle.js',
minName : 'bundle.min.js',
mapName : 'bundle.min.map',
sass : 'assets/sass/*.scss',
css : './css'
};
function bundle( enableWatching ) {
var bundler, performBundle;
bundler = browserify(paths.entry, {
//Source maps
debug: true,
//watchify args
cache: {},
packageCache: {},
fullPaths: true
});
if( enableWatching ) {
bundler = watchify( bundler );
}
performBundle = function() {
//gulp.start('jshint');
var stream = bundler
.transform(reactify)
.bundle()
.pipe( source( paths.bundleName ))
.pipe( gulp.dest( paths.build ));
gutil.beep();
gutil.log('Bundle rebuilt');
return stream;
};
bundler.on('update', performBundle);
return performBundle();
}
gulp.task('default', ['watch']);
gulp.task('watch', function() {
bundle( true );
});
gulp.task('watch-sass', function() {
gulp.watch( paths.sass, ['sass'] );
});
gulp.task('sass', function() {
gulp.src( paths.sass )
.pipe(sass())
.pipe(gulp.dest( paths.css ));
});
gulp.task('build', function() {
gulp.start('bundle');
gulp.start('minify');
});
gulp.task('bundle', function() {
bundle();
});
gulp.task('minify', function() {
gulp.src( paths.build + paths.bundleName )
.pipe(sourcemaps.init({loadMaps: true}))
.pipe( uglify() )
.pipe( rename( paths.minName ) )
.pipe( gulp.dest( paths.build ))
.pipe( sourcemaps.write('.'))
.pipe( gulp.dest( paths.build ));
});
gulp.task('jshint', function() {
return gulp.src(paths.js)
.pipe( react() )
.pipe( jshint('./.jshintrc') )
.pipe( jshint.reporter('jshint-stylish') );
});
Having teh same problems. its all ok on mac - just restart task and enjoy, but suddenly, first bundle on mustdie win8 takes about 200 seconds so it's a world of pain
Seems to be Gulp specific issue, closing.
check if you are closing tag "h2" in same small letters
https://github.com/substack/watchify/issues/64
I'm running into this issue from Watchify which was closed because their tests passed, even though the error still seems to be there. I'm wondering if it's something in the implementation with Reactify.
Terminal output:
package.json versions I'm running