File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ module.exports = function (api: any, options: NxReactBabelPresetOptions = {}) {
1616 api . assertVersion ( 7 ) ;
1717
1818 const isModern = api . caller ( ( caller ) => caller ?. isModern ) ;
19+ // `isServer` is passed from `next-babel-loader`, when it compiles for the server
20+ const isServer = api . caller ( ( caller ) => caller ?. isServer ) ;
1921 const emitDecoratorMetadata = api . caller (
2022 ( caller ) => caller ?. emitDecoratorMetadata ?? true
2123 ) ;
@@ -28,7 +30,7 @@ module.exports = function (api: any, options: NxReactBabelPresetOptions = {}) {
2830 // For Jest tests, NODE_ENV is set as 'test' and we only want to set target as Node.
2931 // All other options will fail in Jest since Node does not support some ES features
3032 // such as import syntax.
31- process . env . NODE_ENV === 'test'
33+ isServer || process . env . NODE_ENV === 'test'
3234 ? { targets : { node : 'current' } }
3335 : {
3436 // Allow importing core-js in entrypoint and use browserlist to select polyfills.
You can’t perform that action at this time.
0 commit comments