From a58baacdc8a922b948dfd9a8612e2dff18ee5a79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lorber?= Date: Fri, 19 Feb 2021 17:55:03 +0100 Subject: [PATCH] fix(v2): fix LTR PostCSS bug on Netlify/monorepo symlinks (#4254) --- packages/docusaurus-theme-classic/src/index.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/docusaurus-theme-classic/src/index.ts b/packages/docusaurus-theme-classic/src/index.ts index c35f4086b3ac..ef4dc6393fed 100644 --- a/packages/docusaurus-theme-classic/src/index.ts +++ b/packages/docusaurus-theme-classic/src/index.ts @@ -157,14 +157,11 @@ export default function docusaurusThemeClassic( if (direction === 'rtl') { postCssOptions.plugins.push( postcss.plugin('RtlCssPlugin', () => { + const resolvedInfimaFile = require.resolve( + getInfimaCSSFile(direction), + ); function isInfimaCSSFile(file) { - return ( - file.endsWith(getInfimaCSSFile(direction)) || - // special case for our own monorepo using symlinks! - file.endsWith( - 'infima/packages/core/dist/css/default/default-rtl.css', - ) - ); + return file === resolvedInfimaFile; } return function (root: any) {