Skip to content

Commit 28eca60

Browse files
committed
Move production env check to be usable
1 parent 98da747 commit 28eca60

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

packages/babel-preset-react-app/index.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,15 @@ module.exports = (context, opts = {}) => {
9696
]),
9797
};
9898
} else {
99+
if (env === 'production') {
100+
// Optimization: hoist JSX that never changes out of render()
101+
// Disabled because of issues: https://github.com/facebookincubator/create-react-app/issues/553
102+
// TODO: Enable again when these issues are resolved.
103+
// plugins.push.apply(plugins, [
104+
// require.resolve('babel-plugin-transform-react-constant-elements')
105+
// ]);
106+
}
107+
99108
return {
100109
presets: [
101110
// Latest stable ECMAScript features
@@ -131,14 +140,5 @@ module.exports = (context, opts = {}) => {
131140
require.resolve('babel-plugin-syntax-dynamic-import'),
132141
]),
133142
};
134-
135-
if (env === 'production') {
136-
// Optimization: hoist JSX that never changes out of render()
137-
// Disabled because of issues: https://github.com/facebookincubator/create-react-app/issues/553
138-
// TODO: Enable again when these issues are resolved.
139-
// plugins.push.apply(plugins, [
140-
// require.resolve('babel-plugin-transform-react-constant-elements')
141-
// ]);
142-
}
143143
}
144144
};

0 commit comments

Comments
 (0)