Skip to content

Commit 7e1e66c

Browse files
authoredFeb 29, 2024
chore: stop generating re-export stubs for clients (#5842)
1 parent f05b540 commit 7e1e66c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed
 

‎scripts/compilation/Inliner.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,15 @@ module.exports = class Inliner {
203203
.map(() => "..")
204204
.join("/")) + "/index.js";
205205

206-
fs.writeFileSync(file, `module.exports = require("${indexRelativePath}");`);
206+
if (this.isClient) {
207+
fs.rmSync(file);
208+
const files = fs.readdirSync(path.dirname(file));
209+
if (files.length === 0) {
210+
fs.rmdirSync(path.dirname(file));
211+
}
212+
} else {
213+
fs.writeFileSync(file, `module.exports = require("${indexRelativePath}");`);
214+
}
207215
}
208216

209217
return this;

0 commit comments

Comments
 (0)