question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using reactify with the --es6 flag

See original GitHub issue

Hi sorry if it’s an obvious question but I’ve been digging int he code that calls the transformers and can not see how to send this option to the transformer I’m using (reactify). Probable I need to configure the transformer in a different way but still not sure how to set the parameter.

This is my current code. How can I set options on that particular transformer?, is it possible the reactify API is not compatible for setting the option?.

The option I need to set is ‘–es6’, which I guess will become {es6: true}

var browserify = require('browserify-middleware');
browserify.settings({
  transform: ['reactify'],
  extensions: ['.js', '.jsx'],
  grep: /\.jsx?$/
})

Thanks!

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
rafaelchiticommented, Apr 24, 2014

Nevermind, silly of me a friend just spotted out how to configure it.

var browserify = require('browserify-middleware');
var reactify = require('reactify');

var reactifyES6 = function(file) {
  return reactify(file, {'es6': true});
};

browserify.settings({
  transform: [reactifyES6],
  extensions: ['.js', '.jsx'],
  grep: /\.jsx?$/
})
0reactions
kelunikcommented, Dec 25, 2015

Thanks for sharing!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting reactify and browserify to work with ES6 - Stack Overflow
I was missing a bracket after the transform option. This works: module.exports = function(grunt) { grunt.config.set('browserify', ...
Read more >
Surface nonStrictEs6module option · Issue #58 - GitHub
non-strict-es6-module is a new option to jsx and react-tools transform which must be set to enable type imports in Flow.
Read more >
Developing React.js Components Using ES6 - I Like Kill Nerds
This article assumes you are familiar with basic React.js concepts and you're curious about writing React components using ES6.
Read more >
Making Your First Webapp with React - Tutorialzine
Reactify supports a limited set of the new ES6 features with the --es6 flag, which I've used in the source code (you will...
Read more >
ReactJS and ES2015/JSX transpilation - S. Derosiaux
React was in version 0.13.0rc1. nodejs was still using harmony flags to enable ES2015 features. Babel was not modular yet.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found