这是我的gulpfile代码:
gulp.task('react', function () {
browserify('app/src/main.jsx')
.transform(reactify)
.transform(babelify)
.bundle()
.pipe(source('app.js'))
.pipe(streamify(uglify()))
.pipe(gulp.dest('dist/js/'));
});
Run Code Online (Sandbox Code Playgroud)
只运行第一个转换语句,因此由于缺少额外的转换而抛出错误(我在ES6和JSX中编写w/react).
我完全失去了,真的很感激帮助.
这是我到目前为止所做的,我正在努力找到一个解决方案,以便:
ws api在这里
router.post('/', function (req, res) {
// Need to send ws.send() with post data
})
wss.on('connection', function(ws) {
ws.on('message', function(message) {
console.log('r : %s', message);
});
// ws is only defined under this callback as an object of type ws
});
Run Code Online (Sandbox Code Playgroud)