StephenGrider / ReactCasts

App by app code for Build Web Apps with React JS
586 stars 244 forks source link

Gulp build doesn't update main.js #7

Open ratonjuancarlos opened 8 years ago

ronishak commented 8 years ago

I have the same issue!

adhitia commented 8 years ago

I also have same issue, main.js is not updated, then i delete main.js its not generated anymore

StephenGrider commented 8 years ago

@ronishak @adhitia Can you please post your project directories to github? Please mention me once you have

drewboardman commented 8 years ago

I have the exact same issue. Checked the files and they are identical to @StephenGrider.

var gulp = require('gulp');
var gutil = require('gulp-util');
var source = require('vinyl-source-stream');
var browserify = require('browserify');
var watchify = require('watchify');
var reactify = require('reactify');

gulp.task('default', function() {
  var bundler = watchify(browserify({
    entries: ['./src/app.jsx'],
    transform: [reactify],
    extensions: ['.jsx'],
    debug: true,
    cache: {},
    packageCache: {},
    fullPaths: true
  }));

  function build(file) {
    if (file) gutil.log('Recompiling ' + file);
    return bundler
      .bundle()
      .on('error', gutil.log.bind(gutil, 'Browserify Error'))
      .pipe(source('main.js'))
      .pipe(gulp.dest('./'));
  };
  build()
  bundler.on('update', build)
});

I am running this in the project directory with gulp

StephenGrider commented 8 years ago

@drewboardman Can you post your package.json as well? I was able to check out the version of the thumbnail-gulp project in this repo, install dependencies, run gulp, and saw updates to main.js occur whenever I edited a file.

drewboardman commented 8 years ago

Hey, thanks for the reply. Here is my package.json

{
  "name": "thumbnail-gulp",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "browserify": "^12.0.1",
    "gulp": "^3.9.0",
    "gulp-concat": "^2.6.0",
    "gulp-ignore": "^2.0.1",
    "gulp-plumber": "^1.0.1",
    "gulp-react": "^3.1.0",
    "gulp-util": "^3.0.7",
    "react": "^0.13.3",
    "reactify": "^1.1.1",
    "vinyl-source-stream": "^1.1.0",
    "watchify": "^3.6.1"
  }
}
ronishak commented 8 years ago

@StephenGrider here is a repo that also stopped updating the main.js https://github.com/ronishak/imgur-client

StephenGrider commented 8 years ago

@ronishak Can you try the following:

mixins: [
    Reflux.listenTo(TopicStore, 'onChange')
  ], // comma here
  getInitialState: function() {

Then run gulp again.

drewboardman commented 8 years ago

@StephenGrider Do you have any idea why mine isn't auto-recompiling?

ronishak commented 8 years ago

wow well that was embarrassing! A single comma did all that and I didnt get any errors! @StephenGrider is there a way to avoid this? what linting packages did you use to find that missing comma in sublime/atom? I'm still shocked a comma stopped my progress for two days..