ReactCasts
ReactCasts copied to clipboard
Gulp build doesn't update main.js
I have the same issue!
I also have same issue, main.js is not updated, then i delete main.js its not generated anymore
@ronishak @adhitia Can you please post your project directories to github? Please mention me once you have
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
@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.
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"
}
}
@StephenGrider here is a repo that also stopped updating the main.js https://github.com/ronishak/imgur-client
@ronishak Can you try the following:
- In package.json, change
"react-router": "^1.0.0-beta2",
to"react-router": "1.0.0-beta2",
, save, then runnpm update react-router
. - In
topic-list.jsx
, add a comma after the mixin delcaration, so you should have
mixins: [
Reflux.listenTo(TopicStore, 'onChange')
], // comma here
getInitialState: function() {
Then run gulp again.
@StephenGrider Do you have any idea why mine isn't auto-recompiling?
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..