2
Şişeyi kullanarak basit bir uygulama projesi yapıyorum ve ön uç şeyler için tepki veriyorum. Paketleme ve derlemek için gulp kullanmaya çalışıyorum ama bu hata ile sıkışıp kaldım. gulpfile.js dosyasındaki sözdizimi hatası
yudum çalıştırmak çalışırken alıyorum hata im Bu:gulpfile.js:9
SyntaxError: Unexpected token ILLEGAL
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Liftoff.handleArguments (/usr/local/lib/node_modules/gulp/bin/gulp.js:116:3)
at Liftoff.<anonymous> (/usr/local/lib/node_modules/gulp/node_modules/liftoff/index.js:193:16)
at module.exports (/usr/local/lib/node_modules/gulp/node_modules/liftoff/node_modules/flagged-respawn/index.js:17:3)
at Liftoff.<anonymous> (/usr/local/lib/node_modules/gul7
Bu benim gulpfile.js geçerli:
var gulp = require('gulp');
var browserify = require('browserify');
var babelify = require('babelify');
var source = require('vinyl-source-stream');
var rename = require('gulp-rename');
var es = require('event-stream');
var uglify = require('gulp-uglify');
var buffer = require('vinyl-buffer');
gulp.task('transform', function() {
var files = [
'index.jsx'
];
var tasks = files.map(function(entry){
return browserify({entries: './static/jsx/' + entry})
.transform('babelify', {presets: ['es2015', 'react']})
.bundle()
.on('error', function(err){
console.log(err.stack);
this.emit('end');
})
.pipe(source(entry))
.pipe(buffer())
.pipe(uglify())
.pipe(rename({
extname: '.js'
}))
.pipe(gulp.dest('./app/static/js'));
});
return es.merge.apply(null,tasks);
});
gulp.task('watch', ['transform'], function() {
gulp.watch('./app/static/jsx/**/*.jsx', ['transform']);
});
gulp.task('default', ['watch']);