This repository has been archived by the owner on Apr 9, 2020. It is now read-only.
Add configuration for which transforms to run in production #7
Labels
Comments
Maybe we can solve this on Babel configuration level. |
For example, a config could look like this: {
"stage": 0,
"env": {
"development": {
"plugins": ["react-transform"],
"extra": {
"react-transform": [{
"target": "react-transform-webpack-hmr",
"imports": ["react"],
"locals": ["module"]
}, {
"target": "react-transform-catch-errors",
"imports": ["react", "redbox-react"]
}]
}
}
}
} You'd need to compile your project with
(Unix) or
(Windows) |
I can confirm that using the babel env option works exactly as expected. No changes required at all. |
using env works for me too |
here to confirm redundantly that babel env also worked for me |
Closing, as it's not our responsibility. Users can either use |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Right now, transforms have to include special code to opt out of production effect. Even if they are no-ops, the code to call them is still generated, and any
imports
are still imported.I think we should change this behavior:
production: true
which enables it in productionThe text was updated successfully, but these errors were encountered: