From 7e1e66cddb4baa52b88a3abff32d88f8cf4ede19 Mon Sep 17 00:00:00 2001 From: George Fu Date: Thu, 29 Feb 2024 13:47:39 -0500 Subject: [PATCH] chore: stop generating re-export stubs for clients (#5842) --- scripts/compilation/Inliner.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/compilation/Inliner.js b/scripts/compilation/Inliner.js index 2d48448764ec..717da9a71716 100644 --- a/scripts/compilation/Inliner.js +++ b/scripts/compilation/Inliner.js @@ -203,7 +203,15 @@ module.exports = class Inliner { .map(() => "..") .join("/")) + "/index.js"; - fs.writeFileSync(file, `module.exports = require("${indexRelativePath}");`); + if (this.isClient) { + fs.rmSync(file); + const files = fs.readdirSync(path.dirname(file)); + if (files.length === 0) { + fs.rmdirSync(path.dirname(file)); + } + } else { + fs.writeFileSync(file, `module.exports = require("${indexRelativePath}");`); + } } return this;