小编MNZ*_*NZT的帖子

Gulp,Reactify和Babelify没有一起变换

这是我的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).

我完全失去了,真的很感激帮助.

browserify reactjs gulp babeljs reactify

6
推荐指数
1
解决办法
2280
查看次数

Express router + WebSocketServer - 在POST上发送消息

这是我到目前为止所做的,我正在努力找到一个解决方案,以便:

  • 连接始终保持活动状态,因此我可以处理状态更新
  • 我可以使用POST请求中的数据向客户端发送websocket消息

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)

websocket node.js express

3
推荐指数
1
解决办法
1905
查看次数

标签 统计

babeljs ×1

browserify ×1

express ×1

gulp ×1

node.js ×1

reactify ×1

reactjs ×1

websocket ×1