refactor: consume Commonlib as a package

This commit is contained in:
vorotamoroz
2026-07-17 11:13:16 +00:00
parent 6475d32769
commit a721d3b602
665 changed files with 3438 additions and 31592 deletions
+4
View File
@@ -73,8 +73,12 @@ const moduleAliasPlugin = {
const removePragmaCommentsPlugin = {
name: "remove-pragma-comments",
setup(build) {
const sourceRoot = `${path.resolve("src")}${path.sep}`;
// Filter target extensions (e.g., JavaScript and TypeScript)
build.onLoad({ filter: /\.[jt]s?$/ }, async (args) => {
// Dependencies are already compiled and may contain comment-like text inside strings.
// Only maintained plug-in source needs its local suppression directives removed.
if (!args.path.startsWith(sourceRoot)) return;
const source = await fs.promises.readFile(args.path, "utf8");
// Regex targeting both single-line and multi-line comments