Skip to content

Commit

Permalink
fix(project-utils): force webpack to use the CJS build of Lexical
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel910 committed Jul 29, 2024
1 parent 4a16b87 commit 4525f46
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/project-utils/bundling/app/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ module.exports = function (webpackEnv, { paths, options }) {
}),
// This is a temporary fix, until we sort out the `react-butterfiles` dependency.
"react-butterfiles": require.resolve("@webiny/app/react-butterfiles"),
// Force `lexical` to use the CJS export.
lexical: require.resolve("lexical"),
...(modules.webpackAliases || {})
},
fallback: {
Expand Down
4 changes: 4 additions & 0 deletions packages/project-utils/bundling/function/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ module.exports = options => {
]
},
resolve: {
alias: {
// Force `lexical` to use the CJS export.
lexical: require.resolve("lexical")
},
modules: [path.resolve(path.join(cwd, "node_modules")), "node_modules"],
extensions: [".ts", ".mjs", ".js", ".json", ".css"]
}
Expand Down
1 change: 1 addition & 0 deletions packages/project-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
"@webiny/api-dynamodb-to-elasticsearch",
"@webiny/api-elasticsearch",
"@webiny/handler-aws",
"lexical",
"pino",
"pino-logger"
],
Expand Down

0 comments on commit 4525f46

Please sign in to comment.