Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recognize babel-plugin-react-transform transformers. #45

Closed
lijunle opened this issue Nov 11, 2015 · 5 comments
Closed

Recognize babel-plugin-react-transform transformers. #45

lijunle opened this issue Nov 11, 2015 · 5 comments
Labels

Comments

@lijunle
Copy link
Member

lijunle commented Nov 11, 2015

Related: #44

NPM document: https://www.npmjs.com/package/babel-plugin-react-transform

Example:

{
  "stage": 2,
  "env": {
    "development": {
      "plugins": [
        "react-transform"
      ],
      "extra": {
        "react-transform": {
          "transforms": [{
            "transform": "react-transform-hmr",
            "imports": ["react"],
            "locals":  ["module"]
          }]
        }
      }
    }
  }
}
@lijunle
Copy link
Member Author

lijunle commented Nov 21, 2015

It is not supporting Babel 6. In such case, I think it is not worth to invest on it.

I will revisit here after Babel 6 is supported by it.

@zeke
Copy link

zeke commented Dec 31, 2015

I ran into a similar issue:

❯ depcheck
Unused Dependencies
* babel-preset-es2015
* babel-preset-react
* babelify

The code in use:

browserify(somePath).transform('babelify', {presets: ['es2015', 'react']})

@smazurov
Copy link

smazurov commented Jan 5, 2016

babel-plugin-react-transform@2.0.0 is released now. Also, we have a slightly different pattern by using multiple webpack configs:

var baseConfig = require('./webpack.config.base');

// Add the hmr transform to the js(x) loader
baseConfig.module.loaders[0].query = {
  compact: false,
  plugins: [
    // must be an array with options object as second item
    ['react-transform', {
      // must be an array of objects
      transforms: [{
        // can be an NPM module name or a local path
        transform: 'react-transform-hmr',
        // see transform docs for 'imports' and 'locals' dependencies
        imports: ['react'],
        locals: ['module']
      }]
    }]
  ]
};

@lijunle
Copy link
Member Author

lijunle commented Jan 7, 2016

Cool! I will take a look after vacation. :)

@lijunle
Copy link
Member Author

lijunle commented Jan 14, 2016

@zeke You are hitting a different issue. Could you please open a new issue for that?

gtanner pushed a commit to gtanner/depcheck that referenced this issue Jan 19, 2016
Refactor Code and Implement Pluggable Design.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants