From 9ecee0f00ebaf32f128098dc11244e2485ebd8ed Mon Sep 17 00:00:00 2001 From: teutat3s Date: Fri, 2 Jun 2023 12:06:46 +0200 Subject: [PATCH] WIP: rtl-css workaround Link node_modules where frappe expects them to be --- node/esbuild-js-fix-css-build.patch | 18 ++++++++++++++++++ node/frappe-assets.nix | 8 ++++++++ 2 files changed, 26 insertions(+) create mode 100644 node/esbuild-js-fix-css-build.patch diff --git a/node/esbuild-js-fix-css-build.patch b/node/esbuild-js-fix-css-build.patch new file mode 100644 index 0000000..28fc624 --- /dev/null +++ b/node/esbuild-js-fix-css-build.patch @@ -0,0 +1,18 @@ +diff --git a/esbuild/esbuild.js b/esbuild/esbuild.js +index c3b59bcd9e..86af51a110 100644 +--- a/esbuild/esbuild.js ++++ b/esbuild/esbuild.js +@@ -166,12 +166,7 @@ function build_assets_for_apps(apps, files) { + files: style_file_map, + outdir: output_path, + }); +- let rtl_style_build = build_style_files({ +- files: rtl_style_file_map, +- outdir: output_path, +- rtl_style: true, +- }); +- return Promise.all([build, style_build, rtl_style_build]); ++ return Promise.all([build, style_build]); + }); + } + diff --git a/node/frappe-assets.nix b/node/frappe-assets.nix index ff72a8f..34111a5 100644 --- a/node/frappe-assets.nix +++ b/node/frappe-assets.nix @@ -52,6 +52,10 @@ let hash = "sha256-PBdMUz9gJIoQaqQYbdk+xnd8CyZPmdeyz/9WznCb4Ss="; }; + patches = [ + ./esbuild-js-fix-css-build.patch + ]; + buildPhase = '' runHook preBuild # Yarn writes cache directories etc to $HOME. @@ -81,6 +85,10 @@ let yarn --offline production + # Frappe expects node_modules linked to this directory + ln -s ${erpnext-modules}/node_modules sites/assets/erpnext/node_modules + ln -s $node_modules sites/assets/frappe/node_modules + # Clean up rm sites/apps.txt