Skip to content

Commit

Permalink
[React] App fails to open in Experience Editor/Headless ssr proxy (#1136
Browse files Browse the repository at this point in the history
)

* [React] App fails to open in Experience Editor/Headless ssr proxy

* Add `isDev` to helpers
  • Loading branch information
illiakovalenko authored Aug 31, 2022
1 parent 9793c7f commit 3c0f5ff
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
openPackageJson,
sortKeys,
writeFileToPath,
isDevEnvironment,
} from '../utils/helpers';
import { diffLines, diffJson, Change } from 'diff';
import { BaseArgs } from '../args/base';
Expand Down Expand Up @@ -209,6 +210,7 @@ export const transform = async (
const ejsData: Data = {
...answers,
helper: {
isDev: isDevEnvironment(answers.destination),
getPascalCaseName: getPascalCaseName,
getAppPrefix: getAppPrefix,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ module.exports = {
options: {
babelrc: false,
presets: [env, reactApp],
plugins: [
[
'@babel/plugin-proposal-private-methods',
{ loose: true }
],
["@babel/plugin-proposal-private-property-in-object", { "loose": true }]
]
},
},
},
Expand Down Expand Up @@ -72,4 +79,12 @@ module.exports = {
// > Critical dependency: the request of a dependency is an expression
new webpack.NormalModuleReplacementPlugin(/\/iconv-loader$/, () => {}),
],
<% if (helper.isDev) { %>
resolve: {
symlinks: false,
alias: {
react: path.resolve(process.cwd(), '.', 'node_modules', 'react')
}
},
<% } %>
};

0 comments on commit 3c0f5ff

Please sign in to comment.