gaearon / react-transform

A specification for tools instrumenting React components
68 stars 2 forks source link

Production #2

Open razvanip opened 8 years ago

razvanip commented 8 years ago

Hello,

I have a transform used in production, let's say a sentry reporter. I am getting this error 'File/Program node, we can't possibly find a statement parent to this'.

in my babelrc for production i use :

"env": {
      "production": {
        "optional": [
          "optimisation.react.constantElements",
          "optimisation.react.inlineElements",
          ],
          "plugins": ["react-transform"],
          "extra": {
            "react-transform": {
              "transforms": [{
                 "transform": "./react-transform-sentry-errors",
                 "imports": ["react","raven-js"],
                 "locals": ["'https://sentry@dns"]
               }]
            }
          }
      },
      "development": {
        "plugins": ["react-transform"],
        "extra": {
          "react-transform": {
            "transforms": [
            {
              "transform": "react-transform-hmr",
              "imports": ["react"],
              "locals": ["module"]
            },
            {
              "transform": "react-transform-catch-errors",
              "imports": ["react", "redbox-react"]
            },           
            ]
          }
        }
      }

if i remove "optimisation.react.constantElements" the webpack build is ok.

GuillaumeCisco commented 8 years ago

I have the same issue. Just wanted to create a folder with an index.js file for exposign a public API as described here : http://jaysoo.ca/2016/02/28/organizing-redux-application/

Any news about it?