From ed44c3c3d2384d7295f781cc5ac709e0c8733c96 Mon Sep 17 00:00:00 2001 From: Pablo Rey Date: Thu, 26 Mar 2026 21:19:48 +0100 Subject: [PATCH 1/2] feat(packages/sui-bundler): do not link on packages with dev script --- packages/sui-bundler/loaders/linkLoaderConfigBuilder.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/sui-bundler/loaders/linkLoaderConfigBuilder.js b/packages/sui-bundler/loaders/linkLoaderConfigBuilder.js index 147f11541..d7c4294da 100644 --- a/packages/sui-bundler/loaders/linkLoaderConfigBuilder.js +++ b/packages/sui-bundler/loaders/linkLoaderConfigBuilder.js @@ -10,8 +10,12 @@ const diccFromAbsolutePaths = (paths, init = {}) => const packagePath = path.resolve(pkg) try { const pkg = require(path.join(packagePath, 'package.json')) - acc[pkg.name] = path.join(packagePath, 'src') - log.success(`✔ ${pkg.name} from path "${packagePath}"`) + if (pkg.scripts?.dev) { + log.info(`ℹ Package from path "${packagePath}" wouldn't be linked because it has its own watcher.`) + } else { + acc[pkg.name] = path.join(packagePath, 'src') + log.success(`✔ ${pkg.name} from path "${packagePath}"`) + } return acc } catch (e) { log.warn(`⚠ Package from path "${packagePath}" can't be linked.\n Path is wrong or package.json is missing.`) From c85779567b1be6893e8a5c3270ed588f0ee40946 Mon Sep 17 00:00:00 2001 From: Pablo Rey Date: Thu, 26 Mar 2026 21:20:01 +0100 Subject: [PATCH 2/2] docs(packages/sui-bundler): update README to explain exclude packages with dev scripts from linking --- packages/sui-bundler/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/sui-bundler/README.md b/packages/sui-bundler/README.md index 21bb6a67b..dedc5fd42 100644 --- a/packages/sui-bundler/README.md +++ b/packages/sui-bundler/README.md @@ -102,6 +102,21 @@ $ sui-bundler dev -L ../frontend-ma--uilib-components/components And of course you can combine `link-all` and `link-package` flags +#### Packages with their own watcher (dev script) + +When using `--link-package` or `--link-all`, packages that define a `dev` script in their `package.json` are **automatically excluded** from being linked by `sui-bundler`. These packages are expected to handle their own file watching and compilation via their `dev` script, so linking them would be redundant or could cause conflicts. + +```json +// package.json of the linked package +{ + "scripts": { + "dev": "tsup --watch" // this package will NOT be linked by sui-bundler + } +} +``` + +> **Note:** If the package is **not part of the monorepo** (i.e. it lives outside the project remember to use [`npm link`](https://docs.npmjs.com/cli/commands/npm-link) directly instead. + ### Production ```