diff --git a/packages/project-utils/bundling/app/config/webpack.config.js b/packages/project-utils/bundling/app/config/webpack.config.js index 90d2b74d8e3..3150e5874a6 100644 --- a/packages/project-utils/bundling/app/config/webpack.config.js +++ b/packages/project-utils/bundling/app/config/webpack.config.js @@ -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: { diff --git a/packages/project-utils/bundling/function/webpack.config.js b/packages/project-utils/bundling/function/webpack.config.js index 0e793bad8d4..79935a6ee22 100644 --- a/packages/project-utils/bundling/function/webpack.config.js +++ b/packages/project-utils/bundling/function/webpack.config.js @@ -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"] } diff --git a/packages/project-utils/package.json b/packages/project-utils/package.json index b8a96f6b931..6766c201db7 100644 --- a/packages/project-utils/package.json +++ b/packages/project-utils/package.json @@ -105,6 +105,7 @@ "@webiny/api-dynamodb-to-elasticsearch", "@webiny/api-elasticsearch", "@webiny/handler-aws", + "lexical", "pino", "pino-logger" ],