Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: patch react-scripts to handle multi react versions error

Abdullah Atta060c17505a45
diff --git a/apps/web/patches/react-scripts+5.0.1.patch b/apps/web/patches/react-scripts+5.0.1.patch
index fe2b25385..853529003 100644
--- a/apps/web/patches/react-scripts+5.0.1.patch
+++ b/apps/web/patches/react-scripts+5.0.1.patch
@@ -1,5 +1,5 @@
diff --git a/node_modules/react-scripts/config/webpack.config.js b/node_modules/react-scripts/config/webpack.config.js
-index e465d8e..35fcbd4 100644
+index e465d8e..7a393f6 100644
--- a/node_modules/react-scripts/config/webpack.config.js
+++ b/node_modules/react-scripts/config/webpack.config.js
@@ -304,6 +304,13 @@ module.exports = function (webpackEnv) {
@@ -16,3 +16,35 @@ index e465d8e..35fcbd4 100644
// We placed these paths second because we want `node_modules` to "win"
// if there are any conflicts. This matches Node resolution mechanism.
// https://github.com/facebook/create-react-app/issues/253
+@@ -327,6 +334,8 @@ module.exports = function (webpackEnv) {
+ ...(isEnvProductionProfile && {
+ 'react-dom$': 'react-dom/profiling',
+ 'scheduler/tracing': 'scheduler/tracing-profiling',
++ "react": path.resolve(path.join(__dirname,'../../react')),
++ "react-dom": path.resolve(path.join(__dirname,'../../react-dom'))
+ }),
+ ...(modules.webpackAliases || {}),
+ },
+@@ -336,14 +345,14 @@ module.exports = function (webpackEnv) {
+ // To fix this, we prevent you from importing files out of src/ -- if you'd like to,
+ // please link the files into your node_modules/ and let module-resolution kick in.
+ // Make sure your source files are compiled, as they will not be processed in any way.
+- new ModuleScopePlugin(paths.appSrc, [
+- paths.appPackageJson,
+- reactRefreshRuntimeEntry,
+- reactRefreshWebpackPluginRuntimeEntry,
+- babelRuntimeEntry,
+- babelRuntimeEntryHelpers,
+- babelRuntimeRegenerator,
+- ]),
++ // new ModuleScopePlugin(paths.appSrc, [
++ // paths.appPackageJson,
++ // reactRefreshRuntimeEntry,
++ // reactRefreshWebpackPluginRuntimeEntry,
++ // babelRuntimeEntry,
++ // babelRuntimeEntryHelpers,
++ // babelRuntimeRegenerator,
++ // ]),
+ ],
+ },
+ module: {